Help to Set Up Simple Pushbutton One-Time Full Rotation Servo

So I'm trying to set up a relatively simple function but I'm having a novice's hard time sorting out the materials to figure out just how to go about it.

What I'm using:

  • Arduino Uno
  • LS-3006 360-rotation servo w/external 9V power source

I've been able to successfully hook up the standard "Button" exercise and get response from the pushbutton arrangement on pin 2.

Separately, I've been able to play with the "Sweep" coding and setup using servo pin 10.

Here's what I would like the final device to do:

When the button is pushed, the servo rotates 1 full 360-degree rotation and stops.

That's it. One push equals one rotation and stops. Continuous, no need to re-set or monitor position or any potentiometer stuff. Continuous servo set to rotate 1 full turn each time the button is pushed and stops, waiting for the next time the button is pushed.

I figure I could simply add the servo as a constant and object to the "Button" script, and simply have the output include a line for the servo to act as an output.

Now all I need to know is just how to properly wire the two up simultaneously to the Arduino and what code to get the servo to run continuously in one direction, 360 degrees at a time.

That's it. One push equals one rotation and stops. Continuous, no need to re-set or monitor position or any potentiometer stuff. Continuous servo set to rotate 1 full turn each time the button is pushed and stops, waiting for the next time the button is pushed.

So how are you going to know that the servo rotated 1 full turn?

You cannot control the position of a continuous rotation servo - only the speed and direction.

That said, if you have a program that can detect a button press and another that can control a servo just combine them as suggested in this demo.

...R