27404 Parallax Inc, 27404 Datasheet - Page 181

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
' -----[ Main Routine ]-------------------------------------------------------
DO
The
this chapter's Activity #1, but with a twist -
Next_State
pattern. If none of the sensors see anything, each
execute. However, if any sensor sees something, the
zero.
DO...LOOP
sensor(s) that changed from 0 to 1 handle the situation. Since there are no IR detectors in
this program, the only sensors that can cause this condition are the QTIs. In the next
activity, all four IR detectors and both QTIs will have an opportunity to set a bit in the
sensors
the state that handles the sensor that went high.
IF qtiLF = 1 THEN
ELSEIF qtiRF = 1 THEN
ELSE
FOR counter = 1 TO 15
NEXT
FOR counter = 1 TO 15
NEXT
FOR counter = 1 TO 15
NEXT
FOR counter = 1 TO 15
NEXT
ELSE
.
.
.
FOR counter = 1 TO 35
NEXT
maneuver = Backward
GOSUB Servos_And_Sensors
maneuver = RotateRight
GOSUB Servos_And_Sensors
maneuver = Backward
GOSUB Servos_And_Sensors
maneuver = RotateLeft
GOSUB Servos_And_Sensors
maneuver = Forward
GOSUB Servos_And_Sensors
IF sensors <> 0 THEN GOTO Next_State
.
.
.
When that happens, the
variable, causing the program to terminate the search condition and transition to
condition in the Main Routine performs the same search pattern introduced in
in the Main Routine repeats itself, and the correct state for handling the
. This
IF...THEN
statement is in all four
ELSE
condition terminates.
' Left qti sees line?
' State = Avoid tawara left
' Back up
' Turn right
' Right qti sees line?
' State = Avoid tawara right
' Back up
' Turn left
' No objects detected?
' State = search pattern
' Straight ahead 35 pulses
IF
sensors
FOR...NEXT
FOR...NEXT
sensors
variable will no longer be
Next, the outermost
<>
loops in the search
loop continues to
0
THEN
GOTO

Related parts for 27404