27403 Parallax Inc, 27403 Datasheet - Page 59

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 27403

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
ENDIF
DEBUG CR, "All done!"
END
ACTIVITY #3: PROGRAM ON/OFF WITH RESET
It's really handy to be able to start and halt a sumo wrestling program by pressing and
releasing the SumoBot's Reset button. This technique was first introduced in Chapter 3
of the SumoBot book. It makes it possible to press and release the Reset button to toggle
between two separate program modes: wrestle, and wait for reset.
Reset Subroutine for the New Program Design
The new
RunStatus
program is downloaded.
' -----[ EEPROM Data ]--------------------------------------------------------
RunStatus
The
Initialization section. The programs in this text will instead call a subroutine named
Reset
' -----[ Initialization ]-----------------------------------------------------
GOSUB Reset
GOSUB Start_Delay
' -----[ Main Routine ]-------------------------------------------------------
ResetTest:
Here is the new Reset subroutine. It uses the odd/even number technique introduced in
Activity #1 of this chapter. In this subroutine, if
it), it displays the "Press/release Reset button" message, and then ends the program. If
LOOP
DEBUG CR, "Done!"
END
Reset
from the Initialization routine.
Reset
. This
routine from the SumoBot text was a code block in the program's
subroutine will still depend on an EEPROM byte with the
DATA
DATA
directive will write 0 to the
0
temp
' Run status EEPROM byte
' Wait for Reset press/release
' 5 Second delay
' Verify we made it to main.
is odd (after 1 has been added to
RunStatus
address when the
Symbol
name

Related parts for 27403