- Notifications
You must be signed in to change notification settings - Fork233
Add PIO example for servo control#29
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
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)
aallan commentedApr 8, 2021
Could you add a |
lurch commentedApr 8, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Nice PIO example 🙂 |
zeroflow commentedApr 8, 2021
I will add a readme. Regarding IRQs: Sharing the IRQ did not work, so I used relative IRQs. |
aallan commentedApr 8, 2021
Sounds like this should be in the README! :) |
lurch commentedApr 8, 2021
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. |
zeroflow commentedApr 8, 2021
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. |
zeroflow commentedApr 8, 2021
Thanks! The replacement with IRQ/Clear + Wait did work. |
lurch commentedApr 8, 2021
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.