Adafruit_CircuitPython_PCA9685 icon indicating copy to clipboard operation
Adafruit_CircuitPython_PCA9685 copied to clipboard

Is there a way to manually turn Pins on/off?

Open mxx-lxg opened this issue 1 year ago • 1 comments

I'm trying to control an RC car and i#ve run into a road block so to say. The cars speed controller needs an activation signal before accepting any PWM signal. That activation signal isn't PWM, but a specific pattern. So my question is, is there any way to turn a Channel on and off manually, so i can put together the activation signal i need?

mxx-lxg avatar Mar 05 '24 11:03 mxx-lxg

Yes. On and off are just the limiting case for 100% and 0% duty cycle. The PCA9685 itself has a special bit in the duty cycle registers: image

To use this via this library, set duty cycle to 0xFFFF for ON and 0 for OFF.

https://docs.circuitpython.org/projects/pca9685/en/latest/api.html#adafruit_pca9685.PWMChannel.duty_cycle 0xffff will always be high, 0 will always be low

Whether this will work or not for your particular setup is something you'll need to test. If the pattern has very specific timing requirements, then it may be tricky.

caternuson avatar Mar 05 '24 15:03 caternuson