Shop OBEX P1 Docs P2 Docs Learn Events
centering value for c/r servo? — Parallax Forums

centering value for c/r servo?

baldi36baldi36 Posts: 6
edited 2006-04-04 01:54 in General Discussion
·is the center value for c/r servo =(1.5*868)?
868 being based on the clock update speed for the javelin. or am i completely off base?

chris

Comments

  • baldi36baldi36 Posts: 6
    edited 2006-03-30 01:41
    along with this.. a value less than 1.5*868 will move the servo one way and a value > 1.5*868 will move the servo in the other direction?
  • baldi36baldi36 Posts: 6
    edited 2006-04-04 00:59
    I would appreciate an answer on this one if it is out there...

    thanks

    chris
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-04 01:04
    Have you tried the example that is installed in the examples\manual_v1_0 folder?· It shows 173 as the standard centering value.

    // Program Listing 4.5 - Basic Servo Control

    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;
    ····· }
    ··· }
    · }
    }

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • baldi36baldi36 Posts: 6
    edited 2006-04-04 01:54
    thanks.

    stupid me never got past the problem of the getChar() not reading in the value. (or not responding to the value, it would appear.) never occurred to me to fudge a value and see what the code did.

    thanks again.

    chris
Sign In or Register to comment.