Datasheet

Chapter 4: Navigation Tips ยท Page 183
' Pause between pulses (remove when using IR object detectors + QTIs).
PAUSE 20
RETURN
' -----[ Subroutine - Read_Line_Sensors ]-------------------------------------
Read_Line_Sensors:
HIGH qtiPwrLeft ' Turn on QTIs
HIGH qtiPwrRight
HIGH qtiSigLeft ' Push signal voltages to 5 V
HIGH qtiSigRight
PAUSE 1 ' Wait 1 ms for capacitors
READ QtiThresh, Word temp ' Get threshold time
INPUT qtiSigLeft ' Start the decays
INPUT qtiSigRight
PULSOUT DummyPin, temp ' Wait threshold time
qtiLF = ~qtiSigLeft ' Snapshot of QTI signal states
qtiRF = ~qtiSigRight
LOW qtiPwrLeft ' Turn off QTIS
LOW qtiPwrRight
RETURN
Your Turn - Looking Around at the Start and Designing a Search Pattern
Figure 4-13 is almost identical to Figure 4-12, but there is one important difference. In
Figure 4-13, the SumoBot looks around before moving forward. Especially if your
SumoBot doesn't happen to see its opponent at the beginning of the match, this first look-
around could easily determine which competitor gets the Yuko point.