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.
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"?