Datasheet

Chapter 5: Debugging and Datalogging · Page 219
.
.
' -----[ Subroutine - Avoid_Tawara_Right ]------------------------------------
Avoid_Tawara_Right:
#IF DEBUG_MODE = 1 #THEN state = ATR #ENDIF
.
.
.
' -----[ Subroutine - Go_Forward ]--------------------------------------------
Go_Forward:
#IF DEBUG_MODE = 1 #THEN state = GF #ENDIF
.
.
.
The Display_All subroutine displays the current sensors variable’s value, navigation
state, and maneuver. The
sensors variable is displayed as an 8-bit binary value with the
BIN8 operator. All the states are displayed with abbreviations that match their constant
names. The maneuver values are displayed as abbreviations of their constant names.
' -----[ Subroutine - Display_All ]-------------------------------------------
#IF DEBUG_MODE = 1 #THEN
Display_All:
DEBUG BIN8 sensors, ' Display sensors byte as bits
CRSRX, 10 ' Cursor to column 10
SELECT state ' Display state
CASE ATL
DEBUG "ATL"
CASE ATR
DEBUG "ATR"
CASE GF
DEBUG "GF"
CASE TFLO
DEBUG "TFLO"
CASE TFRO
DEBUG "TFRO"
CASE TSLO
DEBUG "TSLO"
CASE TSRO
DEBUG "TSRO"
CASE SP
DEBUG "SP"