PWM and Analog Read Support

Duncan IglesiasDuncan Iglesias Posts: 15New Member

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.




  • MarcelloMarcello Posts: 155New Member
  • Duncan IglesiasDuncan Iglesias Posts: 15New Member
    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.

    Alternatively, you can program a slave Arduino to handle all data acquisition and communication via serial, I2C, or rosserial.

    Good luck on your projects!

Sign In or Register to comment.