27404 Parallax Inc, 27404 Datasheet - Page 120

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
LOOP
' -----[ Subroutine - Calibrate_Qtis ]----------------------------------------
Calibrate_Qtis:
' -----[ Subroutine - Read_Line_Sensors ]-------------------------------------
Read_Line_Sensors:
HIGH qtiPwrLeft
HIGH qtiSigLeft
PAUSE 1
RCTIME qtiSigLeft, 1, qtiLeft
LOW qtiPwrLeft
HIGH qtiPwrRight
HIGH qtiSigRight
PAUSE 1
RCTIME qtiSigRight, 1, qtiRight
GOSUB Read_Line_Sensors
qtiThreshold = (qtiLeft + qtiRight) / 2
qtiThreshold = qtiThreshold / 4
IF qtiThreshold > 220 THEN
ELSE
ENDIF
RETURN
HIGH qtiPwrLeft
HIGH qtiPwrRight
HIGH qtiSigLeft
HIGH qtiSigRight
PAUSE 1
INPUT qtiSigLeft
INPUT qtiSigRight
PULSOUT DummyPin, qtiThreshold
qtiStateLeft
qtiStateRight = qtiSigRight
LOW qtiPwrLeft
LOW qtiPwrRight
RETURN
qtiThreshold = qtiThreshold - 220
qtiThreshold = 0
= qtiSigLeft
' Turn left QTI on
' Discharge capacitor
' Measure charge time
' Turn left QTI off
' Turn right QTI on
' Discharge capacitor
' Measure charge time
' Get reflection values
' Calculate average
' Take 1/4 average
' Account for code overhead
' Turn on QTIs
' Push signal voltages to 5 V
' Wait 1 ms for capacitors
' Start the decays
' Wait for threshold time
' Snapshot of QTI signal states
' Turn off QTIS

Related parts for 27404