27404 Parallax Inc, 27404 Datasheet - Page 216

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
With this particular bug, the LED would not turn on in the previous test indicating that
the code just wasn't making it there. Assuming you have already ruled out the possibility
of the front IR object detectors seeing something, the next thing to examine is a
branching problem.
When you wave your hand in front of the right IR object detector, the LED should turn
on. When you wave your hand in front of one of the front IR detectors, the LED should
turn off again. That indicates that a navigation subroutine is getting called, it's just that
it's not the right one. So now, check which one, and the problem will be found.
ACTIVITY #2: CONDITIONAL COMPILING
Commenting and uncommenting lines of test routines can be time consuming and leaves
the door open for a lot of mistakes. Conditional compiler directives can help, and this
activity demonstrates how.
Compiler Directives
Here is a new section, Compiler Definitions. These
downloaded to the BASIC Stamp. Instead, the BASIC Stamp Editor just makes a note to
ELSEIF irLS = 1 THEN
ELSEIF irRS = 1 THEN
GOSUB Track_Side_Left_Object
GOSUB Track_Side_Left_Object
Modify the main routine so that this bug is incorporated.
Start
Track_Side_Right_Object
waving your hand in front of the SumoBot's side-right object detector because
the subroutine never gets called.
Remove the
from the
Add this
DO
IF irRS = 1 THEN HIGH LedSpeaker ELSE LOW LedSpeaker ' <--- Add
IF qtiLF = 1 THEN
GOSUB Avoid_Tawara_Left
by
Track_Side_Right_Object
IF...THEN
TOGGLE
repeating
statement to the
LedSpeaker command and
the
subroutine.
TOGGLE
DO...LOOP
subroutine.
' Left side?
' State = track side left obj.
' Right side?
' State = track side right obj.
' Left qti sees line?
' State = avoid left tawara
The LED should not respond to
LedSpeaker
#DEFINE
LOW LedSpeaker
in the Main Routine.
directives do not get
test
commands
in
the

Related parts for 27404