I am creating a mobile robot at my work using a Raspberry 3b+ as microcontroller. To determine the robot displacement I am using a motor with encoder sensors.
The problem is: I need to read the Encoder channel changing to count the pulses and also determine the direction. To do this I was using a callback to read the pulses edge, but the callback it is not fast enough to get all the edges and I lost information because of that.
A solution that I could think it was to use a C program using the WiringPi library to read the encoder, I tested it and it worked. Now I need to use this C program in my Python project.
Any idea in how I can do that?
popen? See docs.python.org/3/library/subprocess.html