Datasheet
Page 244ยท Applied Robotics with the SumoBot
sensors = temp.HIGHBYTE '
state = temp.NIB1
maneuver = temp.NIB0
GOSUB Display_All
NEXT
END
#ENDIF
' -----[ Subroutine - Reset ]-------------------------------------------------
Reset:
READ RunStatus, temp ' Byte @RunStatus -> temp
temp = temp + 1 ' Increment temp
WRITE RunStatus, temp ' Store new value for next time
IF (temp.BIT0 = 1) THEN ' Examine temp.BIT0
DEBUG CLS, "Press/release Reset", CR, ' 1 -> end, 0 -> keep going
"button..."
END
ELSE
DEBUG CR, "Program running..."
ENDIF
RETURN
' -----[ Subroutine - Start_Delay ]-------------------------------------------
Start_Delay:
FOR counter = 1 TO 5 ' 5 beeps, 1/second
PAUSE 900
FREQOUT LedSpeaker, 100, 3000
NEXT
RETURN
' -----[ Subroutine - Calibrate_Qtis ]----------------------------------------
Calibrate_Qtis:
HIGH qtiPwrLeft ' Turn left QTI on
HIGH qtiSigLeft ' Discharge capacitor
PAUSE 1
RCTIME qtiSigLeft, 1, temp ' Measure charge time
LOW qtiPwrLeft ' Turn left QTI off