two servos

Remember the way we connected a servo to the Arduino, there is a super quick way to turn that into two servo’s and have them run together.

The way to do this is to set up the servo’s as you would and upload this code:

#include <Servo.h>

Servo servoLeft; // Define left servo
Servo servoRight; // Define right servo

int angle = 0; // servo position in degrees
void setup() {
servoLeft.attach(10); // Set left servo to digital pin 10
servoRight.attach(9); // Set right servo to digital pin 9

void loop() { // Loop through motion tests

delay (1500); // Example: move forward

delay (1500); // Example: move forward

// Motion routines for forward, reverse, turns, and stop
void forward() {

void reverse() {


Whats good with this setup is you can insert a push button into the circuit and control the servo’s whenever you push the button. ¬†When setting this up you have to have the power go through the push button into one servo and then into the other.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>