27404 Parallax Inc, 27404 Datasheet - Page 214

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
Testing the Subroutine's Looping Code
Next question: "... is there a problem with the looping code inside the
Track_Side_Right_Object
TOGGLE
Track_Side_Right_Object
rapidly as the loop repeats. To keep from leaving the LED on after the subroutine is
finished, it's a good idea to also add a
RETURN
' -----[ Subroutine - Track_Side_Right_Object ]-------------------------------
Track_Side_Right_Object:
DO UNTIL irRF = 1 OR irLF = 1
TOGGLE LedSpeaker
maneuver = RotateRight
command.
Try it in the practice ring with the 3-position power switch set to 2.
Start your test SumoBot with its opponent on the right and watch the LED to see
if you can discern when it detects its opponent.
After you are done with this test, make sure to either comment the
statement by placing an apostrophe to the left of it, or just delete it. Otherwise,
you will get incorrect results from the next test!
Remember to first remove the test code from the
subroutine.
Modify the
as shown here.
Did the SumoBot catch a glimpse of its opponent or not? Sometimes the LED might
stay on too briefly to actually see. If you want to catch the event, simply remove the ELSE
condition from the IF...THEN statement. It will cause the LED to turn on and stay on the
first time the event you are testing occurs.
This statement is also really good for determining whether your IR object detectors
are oversensitive and detecting far-off objects. Simply place the SumoBot in an empty
ring and let it do its search pattern. If the LED comes on, the detector saw something it
wasn't supposed to.
LedSpeaker
IF irRS = 1 THEN HIGH LedSpeaker
Track_Side_Right_Object
command
subroutine. It makes the LED flicker and the speaker click
subroutine?" One effective way to test this is to put a
LOW LedSpeaker
inside
' Rotate right
' <--- Add
subroutine in CompCodeLedTest.bs2
the
command right before the
DO...LOOP
Servos_And_Sensors
IF...THEN
in
the

Related parts for 27404