Page 78 · Robotics with the Boe-Bot
√
Run the program and verify that the servo connected to P12 is now rotating
between 50 and 60 RPM clockwise.
' Robotics with the Boe-Bot – ServoP12Clockwise.bs2
' Run the servo connected to P12 at full speed clockwise.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
DO
PULSOUT 12, 650
PAUSE 20
LOOP
Example Program: ServoP12Counterclockwise.bs2
You have probably anticipated that making the
greater than 750 will cause the servo to rotate counterclockwise. A
send 1.7 ms pulses as shown in Figure 2-26. This will make the servo turn full speed
counterclockwise.
1.7 ms
Vdd (5 V)
Vss (0 V)
√
Save ServoP12Clockwise.bs2 as ServoP12Counterclockwise.bs2.
√
Modify the program by changing the
from 650 to 850.
√
Run the program and verify that the servo connected to P12 is now rotating
between 50 and 60 RPM counterclockwise.
' Robotics with the Boe-Bot – ServoP12Counterclockwise.bs2
' Run the servo connected to P12 at full speed counterclockwise.
' {$STAMP BS2}
' {$PBASIC 2.5}
PULSOUT
standard servo
www.parallax.com
20 ms
PULSOUT
command's
argument
Duration
of 850 will
Duration
1.7 ms
Figure 2-26
A 1.7 ms Pulse
Train Makes the
Servo Turn Full
Speed
Counterclockwise
command's
argument
Duration
Need help?
Do you have a question about the Boe-Bot and is the answer not in the manual?
Questions and answers