Robot Power Sidewinder Speed controller calibrate

// Calibrate a Robot Power sidewinder speed controller
// uses servo library to communicate with sidewinder
// by WELDER DAN
// robotpower.com/downloads/RobotPower_Sidewinder_quickstart.pdf
//sidewinder is in mix mode no jumpers
//Left ,Right, Forward, Reverse may be reversed
//speed is zero when set to 90, forward is 91-180,reverse is 89-1
// turn is zero when set to 90, left is 1-89, right is 91-180

// this code is not perfect, feel free to tweak it as necessary

#include <Servo.h> // include file creates pwm from ppm

Servo left; // left servo wire going into sidewinder
Servo right; // right servo wire going into sidewinder
int speeddirection = 0;

void setup()
{
Serial.begin(9600); // open serial communication
left.attach(2 ); // attaches the left wire to pin 2 on arduino
right.attach(3 ); // right wire to pin 3
}

void loop()
{
Serial.println (“hold calibrate button for 3 seconds”);
delay (9000); // delay 9 secs

// this emulates moving the transmitter to its extents

for(speeddirection = 1; speeddirection < 180; speeddirection += 1) // adds 1 from 1 to 180
{ //
left.write(speeddirection); //
right.write(speeddirection);
Serial.println(speeddirection);
delay(30); // 30 miliseconds
}
for(speeddirection = 180; speeddirection>=1; speeddirection-=1)
{
left.write(speeddirection); //
right.write(speeddirection);
Serial.println(speeddirection);
delay(60); //
}
left.write(90); // centers the calibrarion to 90
right.write(90); // centers the calibration to 90
delay (5000);
Serial.println (“push calibrate button”);
delay (5000); // now you can set speed and direction

}