![Parallax Boe-Bot Student Manual Download Page 93](http://html2.mh-extra.com/html/parallax/boe-bot/boe-bot_student-manual_3646721093.webp)
Chapter 2: Your Boe-Bot’s Servo Motors
· Page 79
DEBUG "Program Running!"
DO
PULSOUT 12, 850
PAUSE 20
LOOP
Your Turn – P13Clockwise.bs2
√
Modify the
PULSOUT
command’s
Pin
argument so that it makes the servo
connected to P13 turn counterclockwise.
Example Program: ServosP13CcwP12Cw.bs2
You can use two
PULSOUT
commands to make both servos turn at the same time. You
can also make them turn in opposite directions.
√
Enter, save, and run ServosP13CcwP12Cw.bs2.
√
Verify that the servo connected to P13 is turning full speed counterclockwise
while the one connected to P12 is turning full speed clockwise.
' Robotics with the Boe-Bot - ServosP13CcwP12Cw.bs2
' Run the servo connected to P13 at full speed counterclockwise
' and the servo connected to P12 at full speed clockwise.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
DO
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
LOOP
This will be important soon. Think about it: when the servos are mounted on either side
of the chassis, one will have to rotate clockwise while the other rotates counterclockwise
to make the Boe-Bot roll in a straight line. Does that seem odd? If you can’t picture it,
try this:
√
Hold your servos together back-to-back and re-run the program.