-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add PIO example for servo control #29
base: master
Are you sure you want to change the base?
Conversation
Controls one servo at GP16 and additionally the LED (to see, if it's doing anything, and to demonstrate usage of two servo outputs)
Could you add a |
Nice PIO example 🙂 |
I will add a readme. Regarding IRQs: Sharing the IRQ did not work, so I used relative IRQs. |
Sounds like this should be in the README! :) |
I hope you don't mind, but I had a bit of a fiddle.... 😉 (I'm still getting to grips with PIO myself) I was able to get it working with only a single
(which I guess then means I need to change the trig_ctr calculation to
😀 Other comments:
But of course these are only suggestions, I'll leave the final decision up to you. |
I don't mind - I'll check your suggestions later. During my testing, the 1-Trigger 2-Servo code compiled, but the output was garbage. |
Thanks! The replacement with IRQ/Clear + Wait did work. |
When testing the changes that I mentioned above, I had three separate servos all running from a single trigger :) But I had to insert some sleeps between moving each servo individually, because if I tried moving multiple servos at the same time, it tried to pull too much current from my computer's USB port and the Pico reset. (this is fixable by powering the servos from a separate PSU, but I couldn't be bothered to wire that up!) |
Controls one servo at GP16 and additionally the onboard LED
This demonstrates use of two servos.