Hello,
I'm working on Beaglebone for a robotic project. Currently i'm writing a code to get moto's position using encoders.
It is working fine on slow motor speed. But the problem starts when motor speed is fast. I believe, it is due to the processing speed of Adafruit's BBIO Library and Python.
So does anyone has any idea how fast Python Adafruit_BBIO Library can go?
And any suggestion for any faster library in any other language? C++ maybe.
Python Adafruit_BBIO's maximum speed
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Python Adafruit_BBIO's maximum speed
Python is an interpreted language, so it has a lot more overhead than the binaries generated by a C compiler. To find the actual difference, you'd need to write programs that do the same general thing in both languages, loop them over a set of standard operations a few hundred or thousand times, and count the elapsed time for each.
- paulf8080
- Posts: 208
- Joined: Sat Jan 18, 2014 10:25 pm
Re: Python Adafruit_BBIO's maximum speed
Just curious. Are you reading the encoder value a gpio pin at a time. If so, the encoder value can change before all pin reads are completed. Is there a way to read all the pins at once. The HW supports 32 pin groups. You may have to add an external register to capture all encoder pins at once.
Please be positive and constructive with your questions and comments.