Datasheet

Page 20· Applied Robotics with the SumoBot
LOOP
DEBUG "Press/release reset", CR, ' User instructions
"twice to restart...", CR
END
Your Turn - More Pulses, Less Distance
Chapter 4, Activity #3 in Robotics with the Boe-Bot demonstrates how the amount of
time a servo turns translates to distance traveled. When there's less time between each
pulse, the program will have to send the servos more pulses to make them turn for the
same amount of time. This can make a huge difference in certain maneuvers, especially
distance and turns. Let's take a closer look at turns. If the low time between pulses is cut
in half, it means you have to deliver around twice as many pulses to execute the same
maneuver.
Save ForwardLowTimeTest.bs2 as ForwardLowTimeTestYourTurn.bs2
Set the
LowTime CON directive to 40.
Replace the
DO...LOOP in the Main Routine with this:
For counter = 1 to 15 ' Deliver 15 left turn pulses
PULSOUT ServoLeft, 850
PULSOUT ServoRight, 850
PAUSE LowTime
NEXT
Download the modified program to SumoBot A.
Set the
LowTime CON directive to 20.
Modify the Main Routine again, this time doubling the number in the
FOR...NEXT loop's EndValue:
FOR counter = 1 to 30 ' Deliver 30 left turn pulses
PULSOUT ServoLeft, 850
PULSOUT ServoRight, 850
PAUSE LowTime
NEXT
Download the modified program to SumoBot B.