122-28029 Parallax Inc, 122-28029 Datasheet - Page 214

GUIDE STUDENT SMART SENSORS

122-28029

Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-28029

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Smart Sensors
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Page 202 · Smart Sensors and Applications
The code block that follows the variable initialization is the background display. Look
carefully at the
index + symbol, char.
characters in the first background will be displayed. If
characters in the second background would be displayed. If it stored
characters in the third background would be displayed. Since either "
Win
Three routines have to be added to the
displays the player’s score:
The second routine is crucial; it’s a
game. The
current location. If the asterisk is over a space
need to change anything, so the Main Routine’s
checking the accelerometer measurements and updating the asterisk’s location. If the
asterisk is moved over a
a
points several times per second while the asterisk is held over the
moved over a
moves over any one of the
"%"
" will have to be displayed, this routine will be used again later in the program.
character over the
FOR index = 0 TO 242
NEXT
' Display score
DEBUG CRSRXY, 0, 11,
"Score: ", DEC3 points
' Did you move the asterisk over a $, W, I, N, or #?
SELECT char
READ index + symbol, char
DEBUG char
CASE "$"
CASE "#"
CASE "W", "I", "N"
ENDSELECT
SELECT…CASE
points = points + 10
WRITE index, "%"
symbol = YouLose
symbol = YouWin
"#"
READ
, the
command. It has been changed from
YouLose
"$"
"$"
"W" "I"
statement looks at the background character at the asterisk’s
, the program has to add 10 to the
Since the
in EEPROM. This prevents the program from adding 10
symbol is stored in the
or
SELECT…CASE
"N"
DO...LOOP
symbol
letters,
" "
variable was set to store
DO…LOOP
YouWin
statement that enforces the rules of the
in the Main Routine. The first simply
, the
' Display points
' Check background character
' If "$"
' Add points
' Write "%" over "$"
' If "#", set Symbol to YouLose
' If W,I,orN, Symbol -> YouWin
SELECT…CASE
symbol
symbol
is stored in
just keeps on repeating itself,
READ index, char
points
variable. If the asterisk
stored
"$"
symbol
You Lose
. If the asterisk is
variable, and write
statement doesn’t
YouLose
YouWin
Maze
.
" or "
, all the
, all the
, all the
to
READ
You

Related parts for 122-28029