Datasheet
Page 184· Applied Robotics with the SumoBot
Figure 4-13
Sample SumoBot
Search Pattern
This one is different
because the
SumoBot looks
around before it
starts going forward.
There are a couple of different ways to get the SumoBot to do this maneuver. The first is
to write a custom Initialization routine that performs this maneuver before moving on to
the Main Routine. Here's another way.
√ Save SearchPatternAndAvoidTawara.bs2 as a new file with YourTurn.bs2
appended to the name
√ Add the
Look_About: label to the search pattern code. It's commented with
' <--- Add Starting point in the search pattern routine below.
ELSE ' No objects detected?
FOR counter = 1 TO 35 ' State = search pattern
maneuver = Forward
GOSUB Servos_And_Sensors ' Forward
IF sensors <> 0 THEN GOTO Next_State
NEXT
Look_About: ' <--- Add Starting point label
FOR counter = 1 TO 12 ' Look right
maneuver = RotateRight
GOSUB Servos_And_Sensors
IF sensors <> 0 THEN GOTO Next_State
NEXT
.
.
.
ENDIF