Parallax Boe-Bot Student Manual page 93

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

DEBUG "Program Running!"
DO
PULSOUT 12, 850
PAUSE 20
LOOP
Your Turn – P13Clockwise.bs2
Modify the
PULSOUT
connected to P13 turn counterclockwise.
Example Program: ServosP13CcwP12Cw.bs2
You can use two
PULSOUT
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.
Chapter 2: Your Boe-Bot's Servo Motors · Page 79
command's
argument so that it makes the servo
Pin
commands to make both servos turn at the same time. You

Advertisement

Table of Contents
loading

Table of Contents