Datasheet

Chapter 1: Mechanical Adjustments · Page 11
Repeat five to ten times to be sure which SumoBot's plow adjustment has the
advantage.
Adjust the plow of the SumoBot that appeared to lose more often, and repeat the
test.
When you are confident that one of your SumoBots has a winning plow
adjustment, try lots of different adjustments on the other SumoBot to find out if
there is any better adjustment that can make it the winner.
When you are satisfied with your winning SumoBot's plow, leave its adjustment
as-is, and tune the other SumoBot's plow until its chances of winning/losing are
close to even.
Example Program: Forward100Pulses.bs2
' -----[ Program Description ]------------------------------------------------
' Applied Robotics with the SumoBot - Forward100Pulses.bs2
' SumoBot goes forward 100 pulses after Reset button is pressed and released.
' To repeat the forward motion, press/release the Reset button twice.
'
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]---------------------------------------------------
ServoLeft PIN 13 ' Left servo connected to P13
ServoRight PIN 12 ' Right servo connected to P12
' -----[ EEPROM Data ]--------------------------------------------------------
RunStatus DATA 0 ' Start with program not running
' -----[ Variables ]----------------------------------------------------------
temp VAR Byte ' Temporary variable
counter VAR Byte ' FOR...NEXT loop counter
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS ' Clear the Debug Terminal
Reset_Button:
READ RunStatus, temp ' read current status
temp = ~temp ' invert status
WRITE RunStatus, temp ' save for next reset
IF (temp > 0) THEN ' 0 -> End, 1 -> Main routine
DEBUG "Press/release Reset..."
END
ENDIF