I used two parallax hobby servos available at Radio Shack. I could have ordered some specialty brackets online, but I have little patience.
I soldered some header pins onto a perf board for connecting the servo plugs to a prototyping board.
Here is a wiring diagram...
Control is allowed with 2 100K ohm potentiometers .. I think ultimately I will connect it to an analog thumbstick that has been collecting dust for a while.
The code is based on the Arduino Knob example program.// Code to allow the arduino to control 2 servos independently ..
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int potpin1 = 1;
int val; // variables to read the value from the analog pins
myservo.attach(9); // attaches the servo on pin 9 and 10 to the servo object
val = analogRead(potpin); // reads the value of the potentiometer
valu = analogRead(potpin1);
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo s
valu = map(valu, 0, 1023, 0, 179);
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there