3 ms·
a few years back I was curious so I took a self-balancing robot that I had written in C (it did PID in real time to set motors in response to the current angle)
by dekhn 5y ago
a few years back I was curious so I took a self-balancing robot that I had written in C (it did PID in real time to set motors in response to the current angle).
I ported it to Python, with a totally naive simple single threaded loop. It worked perfectly. 25 updates a second, forever. No C code, except the interpreter doing its thing, and some GPIO code.
That's not slow as molasses.