Shop OBEX P1 Docs P2 Docs Learn Events
Controlling multiple servos — Parallax Forums

Controlling multiple servos

prestonaltreeprestonaltree Posts: 6
edited 2008-11-23 19:43 in Robotics
I am building a robot for an upcoming high school science fair and I need programming tips for running two continuous servo motors at the same time:
1) (in the same direction)
2) (in different directions)

Comments

  • P!-RoP!-Ro Posts: 1,189
    edited 2008-11-23 19:43
    What microcontroller are you using? That might help. As for the basics, though, all you need to do is send them a pulse every 20ms. If you are using a basic stamp, your code will look something like this:
    do
    pulsout pin, speed
    pulsout pin2, speed2
    pause 20
    loop

    If you have extra programming to do, shorten the 20ms pause and add your extra code there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pi Guy
Sign In or Register to comment.