Newbie queston: can't get servo to respond

Hi, I'm new to the Arduino world and I'm having trouble getting the Single servo example (Arduino Playground - SingleServoExample) to work...

I have the wiring setup correctly (i think), here are some photos showing the setup:

http://www.mercurygirlinc.com/photo.jpg
http://www.mercurygirlinc.com/photo2.jpg

Tthe servo doesn't respond to the code ,and the serial monitor returns strange characters when i run the program (e.g
<æ??)

The servo is 6v volt, and I'm powering the Arduino with a 7.5 v adaptor.

Where am I going wrong ? Thanks!

My code is below

#include <Servo.h>

Servo servo1; Servo servo2;

void setup() {
servo1.attach(9);
servo2.attach(10);

Serial.begin(19200);
Serial.println("TEST");
}

void loop() {

static int v = 0;

if ( Serial.available()) {
char ch = Serial.read();

switch(ch) {
case '0'...'9':
v = v * 10 + ch - '0';
break;
case 's':
servo1.write(v);
v = 0;
break;
case 'w':
servo2.write(v);
v = 0;
break;
case 'd':
servo2.detach();
break;
case 'a':
servo2.attach(10);
break;
}
}
}

Well it may or may not be a power issue. Though i'm sure it will run fine on 5V. In case you didn't know... Even though you are powering the Arduino with a 7.5V adapter it is only putting out 5V.

If in fact you have it connected as shown then you should have no problems. Just double check that you have the leads in the right place.

the serial monitor returns strange characters when i run the program (e.g
<æ??)

Is the serial monitor set to 19200?

So I played with the wiring and the servo now responds when I touch the white control wire, but the code still doesn't control it, also I switched the baud to 19200 and the correct printin message is displayed

One thing I'm confused about is the analog pin numbering, in the code I am addressing pins 9 and 10, but I have the control wire in pin "Analog In 0"?

Thanks for the help so far

Did you connect the grounds together?

One thing I'm confused about is the analog pin numbering, in the code I am addressing pins 9 and 10, but I have the control wire in pin "Analog In 0"?

Which "control wire"?
The servo's signal wire should be connected to a digital output.
Like pin 9 or 10.

Yes, I just did that and it worked, oops :wink: