Hi all, I am still new to arduino. I need help starting and stopping a continuous servo with a pushbutton. I have the electronics all set up but I'm lost with the coding. I have been researching but I can only find help for changing the direction and they all use delays (I'd like to use millis instead). But I have no idea where to start. Can someone help?
Why do you need ANY delay?
You start the motor spinning, at some speed, when the pin that the switch is connected to first becomes HIGH (or LOW, depending on how the switch is wired). You stop the motor the next time the switch becomes pressed.
There is no reason to even consider delay() or any alternative.
How IS the switch wired? Have you looked at the state change detection example?
How IS the servo wired?
What HAVE you tried?
I just figured it out! Thanks for the response.