Hello,
I apologize in advance for how basic this is, but Google couldn't find me a solution. Here we go:
I have an arduino Uno. I am running two servos off it. They are triggered with a button. I'd like them to each sweep three times and then stop until the button is pressed again.
Right now, when I press the button they sweep over and over until I press it again. I want them to stop on their own. I know there is a simple answer out there but I can't figure it out. Anyone care to divulge?
Right now, when I press the button they sweep over and over until I press it again. I want them to stop on their own. I know there is a simple answer out there but I can't figure it out. Anyone care to divulge?
Put the servo sweep code in a function. When the button becomes depressed enter a for loop that counts from 0 to 2 and call the sweep function from inside the for loop.