28125 Parallax Inc, 28125 Datasheet - Page 93

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
DEBUG "Program Running!"
DO
LOOP
Your Turn – P13Clockwise.bs2
Example Program: ServosP13CcwP12Cw.bs2
You can use two
can also make them turn in opposite directions.
' 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
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:
PULSOUT 12, 850
PAUSE 20
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
Modify the
connected to P13 turn counterclockwise.
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.
Hold your servos together back-to-back and re-run the program.
PULSOUT
PULSOUT
commands to make both servos turn at the same time. You
command’s
Pin
argument so that it makes the servo

Related parts for 28125