Im currently making a costum 10x10 led matrix, and for it to be able to display senseable stuff, im trying to segment the display into 10 vertical lines which cycle at at least 100hz. Would a Python script on a raspberry pi be able to cycle its GPIO pins at this speed? Or Would an arduino or other Microcontroller be able to do it better?

  • RobotToaster@mander.xyz
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    3 days ago

    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.