Go Down

Topic: Toggling servo position (Read 691 times) previous topic - next topic


You need to get rid of the delays if you want the code to respond to the button quickly. Look at the blink without delay sketch.

You will also need to debounce the button, there is also an example sketch for that.



Mr. Zoomkat,
I need to mod this so that the servo toggles after a button press has been detected. In other words I don't want to hold the button down, but send a pulse to the arduino, move the servo 90 degrees, and then wait until another pulse is sent. Do I need to use the boolean command to do that? How do I toggle the state?
Thanks for any help!
Jim in Sweden

Have you tried the code?
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

Go Up