28029 Parallax Inc, 28029 Datasheet - Page 199

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Your Turn - Redrawing the Background without Extra Variables
Keeping track of the old location of the foreground character isn’t always necessary.
Think about it this way: in EepromBackgroundRefresh.bs2 the
old values until you enter new values. By simply rearranging the order in which the
and
Next is a replacement Main Routine you can try in EepromBackgroundRefresh.bs2. As
soon as you press the space bar, your old asterisk disappears. The new asterisk reappears
when you type the second of the two coordinates. As you will see in the next activity,
this technique works really well when the refresh rate is several times per second with tilt
control.
y
variables are displayed, you can eliminate the need for
Save EepromBackgroundRefresh.bs2 as
EepromBackgroundRefreshYourTurn.bs2.
Comment out the
Replace the Main Routine in EepromBackgroundRefresh.bs2 with this one.
Test it and examine the change in the program’s behavior.
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
index = (14 * y) + x + 1
READ index, character
DEBUG CRSRXY, x, y, character
DEBUG CRSRXY, 0, 8,
DEBUGIN SDEC1 x
DEBUG CR, "Type Y coordinate: "
DEBUGIN SDEC1 y
x = (x * 2) + 6
y = 3 - y
DEBUG CRSRXY, x, y, "*"
DEBUG CRSRXY, 0, 10, "Press any Key..."
DEBUGIN temp
DEBUG CRSRXY, 0, 8, CLRDN
"Type X coordinate: "
xOld
and
yOld
variable declarations.
Chapter 5: Accelerometer Gaming Basics · Page 187
' Redisplay background
' Get new coordinates
' Cartesian to DEBUG values
' Display asterisk
' Clear old info
' Wait for user
xOld
x
and
and
y
variables store the
yOld
.
x

Related parts for 28029