Shop OBEX P1 Docs P2 Docs Learn Events
wheels clockwise and counterclockwise — Parallax Forums

wheels clockwise and counterclockwise

SAMYTRIXSAMYTRIX Posts: 11
edited 2006-04-15 16:27 in BASIC Stamp
I have this program


LOW 12
LOW 13

DO
PULSOUT 12, 500
PAUSE 20
PULSOUT 13, 500
PAUSE 20

LOOP

but the wheels go opposite direction, one clockwise and one counterclockwise, however when I use 500ms for one wheel and 1000ms for the other wheel, they both go the same direction, but each wheel's speed is different so bot doesn't go a straight line. What am I doing wrong? thank you

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-15 16:27
    Remember that the servos are "mirrored" so you will have to mirror the control values to get you bot going in one direction (not spinning in place).· The other thing is that there will always be small component variations that we will have to "tune" our code for; don't be concern about this.

    Finally, you only need one PAUSE in your code:

    Test:
    · DO
    ··· PULSOUT 12, 500
    ··· PULSOUT 13,·1000
    ··· PAUSE 20
    · LOOP
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.