Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mxx-lxg opened this issue Mar 5, 2024 · 1 comment
Open

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

mxx-lxg opened this issue Mar 5, 2024 · 1 comment

Comments

@mxx-lxg
Copy link

mxx-lxg commented Mar 5, 2024

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?

@caternuson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants