Go to advanced search

by paddyg
Sun Jun 27, 2021 10:01 pm
Forum: Python
Topic: Missing Python directories when compiling Blender.
Replies: 3
Views: 262

Re: Missing Python directories when compiling Blender.

I think Blender > 2.79 requires OpenGL 3.3 which the RPi can't do
by paddyg
Thu Mar 25, 2021 4:24 pm
Forum: Other programming languages
Topic: Installing Rust on Pi 4, 32 bit Pi OS.
Replies: 11
Views: 4910

Re: Installing Rust on Pi 4, 32 bit Pi OS.

Agree (but draw the line at vim and emac etc). I know Code runs on RPi but it's already become a bit sluggish on an i7 laptop so I would expect it to be quite unpleasant on Pi.
by paddyg
Thu Mar 25, 2021 2:14 pm
Forum: Other programming languages
Topic: Installing Rust on Pi 4, 32 bit Pi OS.
Replies: 11
Views: 4910

Re: Installing Rust on Pi 4, 32 bit Pi OS.

I do everything first on my ubuntu laptop using MS code which has excellent help (drastic reduction in compiler messages!). I use cargo to compile on command line. Generally things will work on the RPi if they work on my laptop (and also cross compile to windows etc).
by paddyg
Sun Feb 14, 2021 1:35 pm
Forum: Python
Topic: Python Array
Replies: 12
Views: 727

Re: Python Array

Probably best summed up by the last paragraph "when can we use python arrays?" ;)
by paddyg
Sun Feb 14, 2021 8:16 am
Forum: Python
Topic: Help with Code
Replies: 6
Views: 379

Re: Help with Code

systemd is definitely the way to go. But IMO extremely hard to debug until you discover journalctl
by paddyg
Sat Feb 13, 2021 10:59 am
Forum: Python
Topic: Python Array
Replies: 12
Views: 727

Re: Python Array

Yes, normally a numpy ndarray is a contiguous 1D 'array' of values in memory and numpy converts the indexing into it to get the required values. It's possible to access a numpy array as if it was a python list of lists [of lists...] but it's significantly slower than using actual lists. Many people ...
by paddyg
Fri Feb 12, 2021 8:05 pm
Forum: Python
Topic: Python Array
Replies: 12
Views: 727

Re: Python Array

It depends what you want to do with the array. numpy is a general purpose very fast module (for small arrays it's a bit slower than lists of list. However it takes about the same time for big arrays. i.e. an array of all the pixels in an image can be processed in fractions of a second) import numpy ...
by paddyg
Fri Feb 05, 2021 10:12 pm
Forum: Python
Topic: Question on threading.
Replies: 4
Views: 347

Re: Question on threading.

MN2M, python threads work fine on the zero and are definitely worth using for your situation. They allow you to structure your code more logically for jobs to get done when events happen. Multiprocessing, in my experience, hardly ever gives significant speed-ups (or the conditions for them to benefi...
by paddyg
Fri Feb 05, 2021 9:56 pm
Forum: Python
Topic: what to use to make GUI apps?
Replies: 2
Views: 292

Re: What do you use?

I thought guizero *was* tkinter (inside a wrapper to make it beginner friendly). Try googling it. The other common approach is pygame. However Qt and gtk are more serious (don't have game in the name) both have python wrappers. Multiple ones unfortunately. Again Google around but I think I would opt...
by paddyg
Wed Feb 03, 2021 10:28 pm
Forum: Python
Topic: multiprocessing Process won't stock when task is done
Replies: 3
Views: 228

Re: multiprocessing Process won't stock when task is done

The other thing you could do (which doesn't require learning Pool) is to start four processes and tell each one to start at different lines in the WL1234 file. It looks very wasteful to pass the file and the password as arguments to the process when it's only going to try one password! If you can re...
by paddyg
Wed Feb 03, 2021 9:10 pm
Forum: Python
Topic: multiprocessing Process won't stock when task is done
Replies: 3
Views: 228

Re: multiprocessing Process won't stock when task is done

How many lines are there in WL1234.txt If there are many then you are probably killing the system by starting lots of processes. You should use a Pool process
by paddyg
Mon Feb 01, 2021 8:00 am
Forum: General discussion
Topic: Raspberry Pi in VR spaceq
Replies: 4
Views: 284

Re: Raspberry Pi in VR spaceq

Sorry should have pasted link properly. I've edited it above, but if you've making the instructable you will need the gyro modifications in that code.
by paddyg
Sat Jan 30, 2021 9:22 pm
Forum: General discussion
Topic: Raspberry Pi in VR spaceq
Replies: 4
Views: 284

Re: Raspberry Pi in VR spaceq

It looks to be quite old, the writer mentions 'stretch' and 'pip install...'. There is a downloadable file which will probably run OK - it's basically the https://github.com/pi3d/pi3d_demos/blob/master/ForestStereo.py with gyro input from an mpu6050. The writer suggests 'sudo pip3 install mpu6050' (...
by paddyg
Sun Jan 17, 2021 11:40 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 279
Views: 56669

Re: Image viewer with transition between images

*Definitely* accept any form of contribution! Sometimes the modifications are a bit specific so I might not include them in entirety. Also the develop branch might have evolved with other changes so the pull might relate to a version from which the code has now diverged - in which case I manually in...
by paddyg
Fri Jan 15, 2021 10:30 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 279
Views: 56669

Re: Image viewer with transition between images

Yes, of course. Well spotted. If you look in PictureFrame2020 you will see that the alpha value of the text_bkg Shape is set to a value varying from 0 to 0.6 then back to 0 . That alpha setting changes a uniform variable unif[17] that is passed to the shader (where it is interpreted as a 2D array un...
by paddyg
Thu Jan 14, 2021 6:43 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 279
Views: 56669

Re: Image viewer with transition between images

@jgodfrey, That scrim system is amazing. It really is almost impossible to see. I think I will convert the standard system as per this """ back_shader = pi3d.Shader("mat_flat") text_bkg = pi3d.Sprite(w=DISPLAY.width, h=90, y=-DISPLAY.height * 0.4 - 20, z=4.0) text_bkg.set_sh...
by paddyg
Thu Jan 14, 2021 5:53 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 279
Views: 56669

Re: Image viewer with transition between images

TLDR; good idea. I will implement that. Hi, off the cuff the only thing I can see happening is where a texture with transparency is drawn before and in front of something. It's hard to avoid that where there are complicated shapes such as the forest in the demos. But the difference is small between ...
by paddyg
Wed Jan 06, 2021 11:27 am
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 279
Views: 56669

Re: Image viewer with transition between images

TLDR; ... "--show_text", default="", ... Hi, Yes this forum still sends me emails when anyone posts something on this thread! The value of config.SHOW_TEXT controls what text gets show see here and that gets set in config.py by looking at the string entered in --show_text see her...
by paddyg
Sun Jan 03, 2021 10:25 am
Forum: Python
Topic: How to have accurate time.sleep()
Replies: 13
Views: 957

Re: How to have accurate time.sleep()

@PiGraham, yes you are absolutely right, and that was actually the conclusion from the previous thread (now you remind me!). Python converts the + 5 to a float value and then you get cumulative float approximation errors. I will edit above - might as well make it as correct as possible. For most pur...
by paddyg
Sat Jan 02, 2021 11:51 pm
Forum: Python
Topic: How to have accurate time.sleep()
Replies: 13
Views: 957

Re: How to have accurate time.sleep()

This has cropped up on this forum a few times. @rpiMike's answer is a good way to do it. You can modify it to give you accuracy of only a few micro seconds and it won't 'accumulate errors'. i.e. MARGIN = 0.00001 #10us DELAY = 5.0 num = 1 start_time = time.time() next_pic = start_time + DELAY while T...
by paddyg
Thu Dec 31, 2020 10:04 pm
Forum: Python
Topic: GPIO.add_event_detect() not working properly!
Replies: 3
Views: 366

Re: GPIO.add_event_detect() not working properly!

Maybe the wire to the GPIO pin is acting as an aerial and picking up voltage fluctuations, I've had that with any kind of length of wire, even with debounce. What happens a) If you pull up and check for falling (don't see why that would make a difference) b) inside my_func have a tiny test loop to m...
by paddyg
Wed Dec 30, 2020 11:05 am
Forum: Python
Topic: Slight adjustment
Replies: 1
Views: 175

Re: Slight adjustment

Try putting your code into a an editor and searching through for the the things you want to control such as show_screen() or hide_screen() then modify the code around them. i.e. if you want the screen to start when the program starts rather than when the doorbell is pressed then move that function c...
by paddyg
Wed Dec 30, 2020 10:40 am
Forum: Python
Topic: Matrix Coding
Replies: 2
Views: 134

Re: Matrix Coding

Really you should use numpy. It's a bit hard to get your head round as it hives all the iteration into its own function. But it's very concise and very, very fast (c.f. python) eg mat = [[[1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1,1], [1,1...
by paddyg
Tue Dec 29, 2020 4:58 pm
Forum: Python
Topic: Vulkan
Replies: 11
Views: 704

Re: Vulkan

Gavin, I'm keen to get https://bevyengine.org/ working but it only uses vulkan at the moment and it complains that the required drivers aren't available on this ubuntu laptop (everything I try apt installing is already there and the latest version!). Maybe I will have to compile them.
by paddyg
Sun Nov 29, 2020 11:00 pm
Forum: Python
Topic: Complete Beginner - importing and running modules
Replies: 1
Views: 181

Re: Complete Beginner - importing and running modules

When you import a module it's a bit like cutting and pasting the code from the module file into where the import statement is, so code will just get executed. You should put the bits of code you want to run at certain times into functions - ideally making them as general as possible so: rotate(angle...

Go to advanced search