Javelin Beginner Help (Servos)
I just started using the javelin stamp and don't know how to program a servo to move. I tried the example program but it didn't work. Can anyone post a sample program. I just want the servo to move
![smilewinkgrin.gif](http://forums.parallax.com/images/smilies/smilewinkgrin.gif)
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
public class ServoControl {
static PWM servo = new PWM(CPU.pin12,173,2304);
public static void main() {
System.out.println("Welcome to Servo Control: ");
System.out.println(" r - right");
System.out.println(" l - left");
System.out.println(" c - center");
while (true) {
switch ( Terminal.getChar() ) {
case 'r':
servo.update(130,2304);
break;
case 'l':
servo.update(220,2304);
break;
case 'c':
servo.update(173,2304);
break;
}
}
}
}
If you read page 72 of the javelin manual (http://www.parallax.com/tabid/443/Default.aspx), it suggests that you must connect VM to either Vdd or Vin to supply the servo port with motor power. I see from your photo that this is not done.
Try it [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith