Datasheet
Page 224ยท Applied Robotics with the SumoBot
' State constants.
ATL CON 0 ' Avoid_Tawara_Left
ATR CON 1 ' Avoid_Tawara_Right
GF CON 2 ' Go-Forward
TFLO CON 3 ' Track_Front_Left_Object
TFRO CON 4 ' Track_Front_Right_Object
TSLO CON 5 ' Track_Side_Left_Object
TSRO CON 6 ' Track_Side_Right_Object
SP CON 7 ' Search_Pattern
#ENDIF
' -----[ Variables ]----------------------------------------------------------
temp VAR Word ' Temporary variable
multi VAR Word ' Multipurpose variable
counter VAR Byte ' Loop counting variable.
maneuver VAR Nib ' SumoBot travel maneuver
sensors VAR Byte ' Sensor flags byte
qtiLF VAR sensors.BIT5 ' Stores snapshot of QtiSigLeft
qtiRF VAR sensors.BIT4 ' Stores snapshot of QtiSigRight
irLS VAR sensors.BIT3 ' State of Left Side IR
irLF VAR sensors.BIT2 ' State of Left Front IR
irRF VAR sensors.BIT1 ' State of Right Front IR
irRS VAR sensors.BIT0 ' State of Right Side IR
#IF DEBUG_MODE = 1 #THEN
state VAR Nib ' State machine value
#ENDIF
' -----[ EEPROM Data ]--------------------------------------------------------
RunStatus DATA 0 ' Run status EEPROM byte
QtiThresh DATA Word 0 ' Word for QTI threshold time
' -----[ Initialization ]-----------------------------------------------------
GOSUB Reset ' Wait for Reset press/release
GOSUB Start_Delay ' 5 Second delay
GOSUB Calibrate_Qtis ' Determine b/w threshold
#IF DEBUG_MODE = 1 #THEN
DEBUG CLS, ' Display table heading
"Sensors State Maneuver", CR,
"-------- -------- --------", CR
#ENDIF
GOSUB Look_About ' Was Goto Look_About