27403 Parallax Inc, 27403 Datasheet - Page 116

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
Your Turn - Incorporating the Right QTI
Here's the interesting part, you can add another QTI measurement to the same block of
code that performed the time measurement on the left QTI. The routine will take
approximately the same amount of time, but you will be measuring two QTIs.
Add a variable declaration for the state of the right QTI.
qtiStateLeft
Add this code block right after the code that sets the threshold based on P9
measurements. It should be inserted just above the
statement.
Add the commands with
Routine’s
Save and run the program
Test the program and verify that both QTI's now indicate white tawara line with
0 or black ring surface with 1.
HIGH 7
HIGH 8
PAUSE 1
RCTIME 8, 1, time
threshold = (threshold + (time / 4)) / 2
HIGH 9
HIGH 8
PAUSE 1
INPUT 9
INPUT 8
PULSOUT 5, threshold
qtiStateLeft = IN9
qtiStateRight = IN8
DEBUG HOME, ? qtiStateLeft
DEBUG ? qtiStateRight
PAUSE 100
DO...LOOP
VAR
:
' <---Add
Bit
' <--- Add
' <--- Add
' <--- Add
' <--- Add
comments to the existing code in the Main
IF threshold > 220 THEN

Related parts for 27403