Datasheet

Page 238ยท Applied Robotics with the SumoBot
#IF DATALOG_MODE = 2 #THEN
Playback_Round:
FOR logIndex = 0 TO MaxBytes STEP 2 ' Loop gets all records
READ LogData + logIndex, Word temp ' Get record
sensors = temp.HIGHBYTE '
state = temp.NIB1
maneuver = temp.NIB0
GOSUB Display_All
NEXT
END
#ENDIF
The same state variable that was updated by the navigation subroutines for the
previous example program also has to be updated when
DATALOG_MODE = 1. This
ensures that correct state values are written to EEPROM.
' -----[ Subroutine - Avoid_Tawara_Left ]-------------------------------------
Avoid_Tawara_Left:
#IF DEBUG_MODE = 1 OR DATALOG_MODE = 1 #THEN state = ATL #ENDIF
.
.
.
' -----[ Subroutine - Avoid_Tawara_Right ]------------------------------------
Avoid_Tawara_Right:
#IF DEBUG_MODE = 1 OR DATALOG_MODE = 1 #THEN state = ATR #ENDIF
.
.
.
' -----[ Subroutine - Go_Forward ]--------------------------------------------
Go_Forward:
#IF DEBUG_MODE = 1 OR DATALOG_MODE = 1 #THEN state = GF #ENDIF
.
.
.