Datasheet
Chapter 5: Debugging and Datalogging · Page 239
To display all the datalogged values when DATALOG_MODE = 2, the same Display_All
subroutine from the previous activity's example program is used. So, its conditional
compiler directive has to be adjusted as well.
' -----[ Subroutine - Display_All ]-------------------------------------------
#IF DEBUG_MODE = 1 OR DATALOG_MODE = 2 #THEN
.
.
.
Example Program: SumoWrestlerWithDataLogMode.bs2
This example program can be used to both record and play back the EEPROM values
recorded by a match. You can use it to see what the SumoBot saw and understand what
decisions it made during a round. It will be especially useful for both tuning the sensors
and making adjustments to your competition code. Any time the SumoBot makes a move
that causes it to lose a round, you can use this program to understand how it happened
and correct the problem.
The program has the same debugging functionality as the previous activity's example
program. It's best to start by leading the SumoBot around with your hand so that you can
have a good guess which sensors detect your hand and which maneuvers it should make.
When you use two SumoBots make sure that both are logging data. Reason being, the
WRITE commands between pulses extend the low time long enough that it slows down
the servos slightly. If both are logging data, the playing field is still even.
Did you skip ahead to get here? If you skipped any thing in Chapter 3 or 4, go back
and do it now.
The programs that follow are dependent upon the sensor circuits built, tested and calibrated
in the previous activities in Chapter 3 and 4.
√ Enter and save SumoWrestlerWithDataLogMode.bs2
√ To log a match, start by setting
DEBUG_MODE = 0 and DATALOG_MODE = 1.
√ Download the program to the SumoBot and disconnect the serial cable.
√ Place it on the competition ring, and press and release the Reset button.
√ Place your hand in front of various object detectors as you make mental notes of
how it responds.