27403 Parallax Inc, 27403 Datasheet - Page 213

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 27403

Accessory Type
Manual
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
Before testing each of these questions, it's important to make a disposable copy of the
SumoWrestler.bs2.
Testing for a Cleared Bit
The first question was "...did the
program?" Some LED indicator code can certainly answer this question:
Where you put this line of code can make a big difference in your test. For example, if
it's placed just after the sensor subroutines the program won't have a chance to do all the
other things it does, which might include a coding mistake that clears the
better way to test this question would be to place the LED indicator code just before the
sensor subroutines get called. That way, the program will go all the way through its other
loops giving you better chances of exposing the bug.
' -----[ Subroutine - Servos_And_Sensors ]------------------------------------
Servos_And_Sensors:
GOSUB Pulse_Servos
' Call sensor subroutine(s).
IF irRS = 1 THEN HIGH LedSpeaker ELSE LOW LedSpeaker
sensors = 0
GOSUB Read_Object_Detectors
GOSUB Read_Line_Sensors
RETURN
Save SumoWrestler.bs2 as CompCodeLedTest.bs2
Modify the
shown here.
Run the modified program with the SumoBot's 3-position power switch set to 1.
Make sure no objects are in view of the SumoBot's other three object detectors.
Verify that it correctly indicates when the right side object detector sees and does
not see an object. (Remember to press the SumoBot's Reset button and wait 5
seconds.
IF irRS = 1 THEN HIGH LedSpeaker ELSE LOW LedSpeaker
Servos_And_Sensors
irRf
bit get accidentally cleared somewhere in the
subroutine in CompCodeLedTest.bs2 as
' Call Pulse_Servos subroutine
' Clear previous sensor values
' Call Read_Object_Detectors
' Look for lines
' <--- Add
irRF
bit. A

Related parts for 27403