Using pushbutton to activate modified servos - [solved]

Hello guys, I'm new to Arduino and programming in general, therefore excuse me if I'm repeating the question on the forum.

I'm having trouble understanding and programming the Arduino to do what I want. Basically, when the Arduino is turned on by plugging a 9V battery, I don't want the program to start running right away. I want to press the pushbutton and have the Arduino start the sequence. When the button is pressed, specific servo motors that I have modified for continuous rotation need to move clockwise for five seconds, stop, and turn counter clockwise for five seconds.

If possible, can I use two pushbuttons? One pushbutton is in charge of two specific continuous servos and the other is in charge of two different continuous servos.

Please provide any helpful links, I will appreciate it!

I have attached the code that I use in order to run the continuous servos once the Arduino is turned on.

Generation_2_Program_v1.ino (654 Bytes)

Take a look at Examples/digital/buttons.

Replace digitalWrite(ledPin, HIGH); with your servo code and voilĂ .

Jacques

Hello Jacques, I hope that you're doing well. I followed your steps and got what I was looking for! Thank you so much for your help!

Leo