Datasheet

Page 220ยท Applied Robotics with the SumoBot
ENDSELECT
DEBUG CRSRX, 20 ' Cursor to column 20
SELECT maneuver ' Display maneuver
CASE Forward
DEBUG "Fwd"
CASE Backward
DEBUG "Bkwd"
CASE RotateLeft
DEBUG "RotLft"
CASE RotateRight
DEBUG "RotRt"
CASE CurveLeft
DEBUG "CrvLft"
CASE CurveRight
DEBUG "CrvRt"
ENDSELECT
DEBUG CR ' Carriage return for next line
PAUSE 200 ' Pause 0.2 seconds for reading.
RETURN
#ENDIF
Example Program: SumoWrestlerWithDebugMode.bs2
With this program, you can examine what the SumoBot sees and how its program
responds. Before going into how it works, recall that Chapter 3, Activity #7
demonstrated how to read the bits in the
sensors variable. Figure 5-1 shows the
sensors variable storing an example value.
Figure 5-1
Sensors Variable
Six of the eight bits
each correspond to a
different SumoBot
sensor. Two bits are
unused.
In this case, there is an object directly in front of the SumoBot because both the left and
right IR object detectors (irLF and irRF) store 1s. The IR object detectors on the left and