Datasheet
Page 144· Applied Robotics with the SumoBot
ACTIVITY #1: SERVO CONTROL WITH LOOKUP COMMANDS
Since all the other subroutines in this book have utilized some combination of the
counter and temp variables, why not make it so for servo control subroutines? This
activity demonstrates a way to do it with the
LOOKUP command.
Servo Control Review
Figure 4-1 is a repeat of Figure 1-4 from Chapter 1, Activity #1. A quick review: The left
servo is connected to header X7 on the SumoBot board. The SumoBot's BASIC Stamp
will send the left servo control signals from I/O pin P13. The right servo is connected to
header X6. The SumoBot's BASIC Stamp will send the right servo control signals from
I/O pin P12.
Figure 4-1 SumoBot Servo Connections
Left Right
Your PBASIC programs can control each servo’s speed, direction and run-times with
PULSOUT commands inside a FOR...NEXT loop. Figure 4-2 shows an example. This
FOR...NEXT loop makes the SumoBot's servos turn full speed for one second. The
SumoBot's left servo, which is connected to P13 turns full speed counterclockwise while
its right servo, which is connected to P12, turns full speed clockwise. This combination
of wheel rotations makes the SumoBot travel forward.