0

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?

3
  • Did look search for popen? See docs.python.org/3/library/subprocess.html Commented Nov 10, 2022 at 8:25
  • Will my program be able to pass data between processes? Because I need to read te encoder count in my main program. Commented Nov 10, 2022 at 17:55
  • Yep, it's the idea of popen: read the output of a process like a file Commented Nov 10, 2022 at 19:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.