PWM and Analog Read Support
Duncan Iglesias
New Member Posts: 15 ✭
Hello,
I am developing a robot application on the Up Board and am wondering if there are any existing CPP/Python libraries for PWM read/write for this board that are comparable to the RPi.GPIO library available for the Raspberry Pi boards. No point reinventing the wheel right?
From my experience using the /sys/class/pwm/pwmchip# can only write PWM however not read one in return. So my approach would be to use an interrupt based method to measure the duration of the pulse high through the /sys/class/gpio interface.
Thanks,
DJI
I am developing a robot application on the Up Board and am wondering if there are any existing CPP/Python libraries for PWM read/write for this board that are comparable to the RPi.GPIO library available for the Raspberry Pi boards. No point reinventing the wheel right?
From my experience using the /sys/class/pwm/pwmchip# can only write PWM however not read one in return. So my approach would be to use an interrupt based method to measure the duration of the pulse high through the /sys/class/gpio interface.
Thanks,
DJI
Comments
-
-
To answer my own question on this matter. The Up Board can only generate up to two PWM pins and would require a custom script to read in PWM signals which would be a time hog. Instead, you can just use a hat from this list of compatible hats.
https://up-community.org/wiki/Verified_HATs
Alternatively, you can program a slave Arduino to handle all data acquisition and communication via serial, I2C, or rosserial.
Good luck on your projects!
Duncan