Move two servos at once from the dashboard with two sliders.
This tutorial is part of the Nairda learning path. You can build it step by step inside the app, which checks every block you place before letting you move on.
The steps
- We create a servo called shoulder on pin 9.
- We create another servo called elbow on pin 10.
- We create a number variable called a.
- We create another number variable called b.
- We add a While loop, which repeats forever.
- Inside the loop we drop the first servo, the shoulder.
- We give the shoulder the variable a, which will be its position.
- Behind the shoulder we drop the second servo, the elbow.
- We give the elbow the variable b, so we can move it separately.
- On the dashboard we put a slider and give it the variable a.
- And another slider with the variable b, for the other servo.
When you finish, the app takes you straight to the next tutorial in the path.