yuvi.akshay
Unknown Country
Asked
Hello Athena,
I am using the stepper servo robot skill.
I am trying to add 3 buttons, 1 for CW, 1 for CCW, and 1 to stop. Can you guide me on how I can achieve that? I have 2 stepper motors, both have different travel distance but they come back to position 0.
Related Hardware Arduino Genuino Uno

Thanks - I can help. First, quick clarification so I give exactly what you need:
Answer those and I’ll tailor code/instructions. Below are two ready-to-use examples: (A) Arduino-side code for physical buttons using AccelStepper with acceleration and deceleration (non-blocking); and (B) ARC-side method (if you prefer UI buttons in ARC to control virtual servos from the Stepper servo robot skill).
Wiring notes:
Arduino code:
Notes & tuning:
Useful links
Next steps / Questions
Would you like the alternate "jog while pressed" Arduino code instead?
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
*Note: we have moved your question into its own thread.
The stepper servo skill is a whole different animal. Realize that you start at zero so there's no going backwards below zero. You can go forwards up to about 65k individual pulses and go back down to zero that's it. Yes you can make it stop, what you are doing is stoping the pulses so it stops moving.