27404 Parallax Inc, 27404 Datasheet - Page 60

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
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
temp
and onward from there.
' -----[ Subroutine - Reset ]-------------------------------------------------
Reset:
If the program has just been downloaded, the
the
EEPROM byte at the RunStatus address to the
to
byte at the
message "Press/release Reset button...". Then, the program ends, which in turn causes
the BASIC Stamp goes into low power mode.
At this point, there is a 1 in the EEPROM byte at the
press and release the Reset button,
to the
temp
program this time. Since
result, the
After that, the
where it calls the next subroutine, then moves on to the Main Routine.
If you press/release the Reset button a third time, it starts again by fetching the 2 from the
RunStatus
ends the program with the "Press/release Reset button..." message. If you press/release
the Reset button a fourth time, it fetches the 3, adds 1 to make it 4, stores it, and
READ RunStatus, temp
temp = temp + 1
WRITE RunStatus, temp
IF (temp.BIT0 = 1) THEN
ELSE
ENDIF
RETURN
temp
RunStatus
DEBUG CLS, "Press/release Reset", CR,
END
DEBUG CR, "Program running..."
is even, it displays "Program running..." and returns the program to initialization
writes that 2 back to EEPROM. The
temp
. The command
IF...THEN
variable.
EEPROM byte, adds 1 to make it 3, then stores it back to EEPROM, and
RunStatus
RETURN
"button..."
address. Then,
temp = temp + 1
statement instead displays the message "Program running...".
statement sends the program back to the Initialization routine,
WRITE RunStatus, temp
address. Since
temp
READ RunStatus, temp
is now an even number,
READ RunStatus, temp
changes that 1 to a 2, and
temp.BIT0
DATA
temp
IF...THEN
' Byte @RunStatus -> temp
' Increment temp
' Store new value for next time
' Examine temp.BIT0
' 1 -> end, 0 -> keep going
directive causes a 0 to be written to
variable.
stores this 1 back to the EEPROM
is 1, the subroutine displays the
RunStatus
temp.BIT0
statement does not end the
copies the value 0 from the
fetches that 1 and copies it
temp = temp + 1
address. When you
WRITE RunStatus,
stores a 0. As a
adds 1

Related parts for 27404