Datasheet
Page 240· Applied Robotics with the SumoBot
√ The SumoBot will log data as it competes for just under 10 seconds, then it
stops.
√ After the SumoBot stops, connect it to the serial cable.
√ Change DATALOG_MODE = 1 to DATALOG_MODE = 2.
√ Run the program and leave the SumoBot connected to the serial cable.
√ Press/release the Reset button. After the speaker beeps 5 times, it will display
the logged data to the Debug Terminal in the same format as the previous
activity.
√ Compare what the Debug Terminal shows to the different sensor conditions the
SumoBot must have seen as you lead it around with your hand.
√ Start practicing this with both your SumoBots set to log data (
DATALOG_MODE =
1
). It will be important to watch them closely, and then examine their data to
determine the factors that contribute to victories or losses. You can then adjust
the sensors and/or the program to improve its performance.
As you expand and modify your program, the accuracy of
DATALOG_MODE recording and
playback may have to be checked. One way to do this is by setting the
DEBUG_MODE and
DATALOG_MODE
values to 1. You can then view the data before it is recorded. Then, set
DEBUG_MODE to 0 and DATALOG_MODE to 2 for playback, and compare the two. As with
the previous activity, it will help to have the 3-position power switch set to 1 and a
controlled set of objects and tawara lines.
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - SumoWrestlerWithDataLogMode.bs2
' SumoWrestler.bs2 modified so that each state is contained by a
' subroutine.
' {$STAMP BS2} ' Target = BASIC Stamp 2
' {$PBASIC 2.5} ' Language = PBASIC 2.5
' -----[ Compiler Definitions ]-----------------------------------------------
#DEFINE DEBUG_MODE = 0 ' 0 -> wrestle
' 1 -> display
#DEFINE DATALOG_MODE = 1 ' 0 -> No log
' 1 -> log round
' 2 -> display log
' -----[ I/O Definitions ]---------------------------------------------------
ServoLeft PIN 13 ' Left servo connected to P13
ServoRight PIN 12 ' Right servo connected to P12