Datasheet
Page 200ยท Applied Robotics with the SumoBot
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
' -----[ Subroutine - Avoid_Tawara_Left ]-------------------------------------
Avoid_Tawara_Left:
FOR counter = 1 TO 15 ' Back up
maneuver = Backward
GOSUB Servos_And_Sensors
NEXT
FOR counter = 1 TO 15 ' Turn right
maneuver = RotateRight
GOSUB Servos_And_Sensors
NEXT
RETURN
' -----[ Subroutine - Avoid_Tawara_Right ]------------------------------------
Avoid_Tawara_Right:
FOR counter = 1 TO 15 ' Back up
maneuver = Backward
GOSUB Servos_And_Sensors
NEXT
FOR counter = 1 TO 15 ' Turn left
maneuver = RotateLeft
GOSUB Servos_And_Sensors
NEXT
RETURN
' -----[ Subroutine - Go_Forward ]--------------------------------------------
Go_Forward:
maneuver = Forward ' 1 forward pulse
GOSUB Servos_And_Sensors