27404 Parallax Inc, 27404 Datasheet - Page 141

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
DO
LOOP
' -----[ Subroutine - Calibrate_Qtis ]----------------------------------------
Calibrate_Qtis:
'
'
'
'
'
'
'
'
'
GOSUB Read_Line_Sensors
GOSUB Read_Object_Detectors
GOSUB Read_Pushbutton
DEBUG CRSRXY, 0, 4, BIN8 sensors
PAUSE 100
HIGH qtiPwrLeft
HIGH qtiSigLeft
PAUSE 1
RCTIME qtiSigLeft, 1, temp
LOW qtiPwrLeft
multi = temp
HIGH qtiPwrRight
HIGH qtiSigRight
PAUSE 1
RCTIME qtiSigRight, 1, temp
multi = (multi + temp) / 2
multi = multi / 4
IF multi > 220 THEN
ELSE
ENDIF
RCTIME qtiSigRight, 1, qtiRight
qtiThreshold = (qtiLeft + qtiRight) / 2
qtiThreshold = qtiThreshold / 4
IF threshold > 220 THEN
ELSE
ENDIF
RCTIME qtiSigLeft, 1, qtiLeft
multi = multi - 220
multi = 0
threshold = threshold - 220
threshold = 0
' DO...LOOP repeats indefinitely
' Look for lines
' Look for objects
' Check pushbutton
' Display Sensors Variable
' Delay for slower PCs
' Turn left QTI on
' Discharge capacitor
' <--- New measure charge time
' Turn left QTI off
' <--- Add
' Turn right QTI on
' Discharge capacitor
' <--- New measure charge time
' <--- New calculate average
' <--- New take 1/4 average
' <--- New
' <--- New
' <--- New
' <--- New
' <--- New
' Measure charge time
' Measure charge time
' Calculate average
' Take 1/4 average
' Account for code overhead

Related parts for 27404