27404 Parallax Inc, 27404 Datasheet - Page 169

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
Figure 4-8 Peripheral Vision for Opponent Detection
Responding to an Object Detection on the Side
This code for side IR object detection works about the same as the examples from the
previous activity. They can be added to the
example program's main routine. They will make the SumoBot respond by rotating in
place to turn toward objects it detects on either side. If an object is on the SumoBot's left
side, the
makes the SumoBot rotate left until either one of the front IR detectors sees the object.
The
side.
ELSEIF irLS = 1 THEN
ELSEIF irRS = 1 THEN
DO UNTIL irRF = 1 OR irLF = 1
LOOP
DO UNTIL irRF = 1 OR irLF = 1
LOOP
ELSEIF irRS = 1 THEN...
maneuver = RotateLeft
GOSUB Servos_And_Sensors
maneuver = RotateRight
GOSUB Servos_And_Sensors
ELSEIF irLS = 1 THEN
code block will get executed. The
code block behaves similarly for objects on the right
IF...THEN
' Object left side?
' State = track left side object
' Rotate left
' Object right side?
' State = track right side object
' Rotate right
statements in the previous
DO UNTIL...LOOP

Related parts for 27404