Shop OBEX P1 Docs P2 Docs Learn Events
Javelin Beginner Help (Servos) — Parallax Forums

Javelin Beginner Help (Servos)

yeseniayesenia Posts: 2
edited 2009-03-20 01:46 in General Discussion
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

Comments

  • Istha PowronIstha Powron Posts: 74
    edited 2009-03-19 22:00
    Can you post the sample program and give us a drawing of how you hav ethe servo connected?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    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
  • yeseniayesenia Posts: 2
    edited 2009-03-20 00:53
    import stamp.core.*;
    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;
    }
    }
    }
    }
    2848 x 2134 - 1M
  • Istha PowronIstha Powron Posts: 74
    edited 2009-03-20 01:46
    yessenia,

    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
Sign In or Register to comment.