this post was submitted on 18 Dec 2025
7 points (100.0% liked)
raspberrypi
5230 readers
1 users here now
Community about the single-board computers, micro-controllers and related projects.
Other RaspberryPi communities on Lemmy
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Short answer: It will probably work, since I assume you don't need the timing to be reliable. It could start to glitch if the pi is under heavy load.
Since you're using python I'll assume you're using linux. Linux isn't a real time operating system, so it is generally terrible at doing things like this. The issue is your program can be paused by the scheduler while the OS is doing something else, so any timing you request is not guaranteed. Now, a pi is ridiculously overpowered for this, so you'll probably get away with it if that's all the pi is doing, but under heavy load you could see the OS prioritise other processes and your display will freeze.
You could install the preempt_rt patches to make it do real time better, this changes Linux into something that resembles a real time operating system, I don't have any experience with it though.
Generally something like this is better done by a microcontroller, because it isn't constantly trying to juggle a hundred different tasks like an operating system is.
There are custom RTOS like Zephyr which run on pi.
Also Linux has RTOS versions which are pretty decent.