28029 Parallax Inc, 28029 Datasheet - Page 304

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
Page 292 · Smart Sensors and Applications
Figure 7-5: Accelerometer X and Y Axes
This simplest way to convert TwoAxisBarDisplay.bs2 to a dual-axis accelerometer
leveling tool is to borrow code blocks from Chapter 3 and adjust them as needed. The
and
HorizontalTilt.bs2 in Chapter 3, Activity #6 provide a starting point. The
scaling
TwoAxisBarDisplay.bs2's Main Routine.
value
be set equal to the scaled x-axis value, and
axis value, subtracted from 16.
y
and
axis variables,
Save TwoAxisBarDisplay.bs2 as TwoAxisBarTiltDisplay.bs2.
Add these two declarations to the program's Variables section.
X
y
Replace the outermost
commands
Deriving the
cursor
VAR
VAR
variables to plot on the LCD. Before it can be called,
**
PULSIN
can
scale constants are left as exercises at the end of the chapter.
Word
Word
replace
DO
commands, and the scale and offset commands from
...
LOOP
the
in the Main Routine with the one below:
cursor
The
DEBUG
' Accelerometer x-axis
' Accelerometer y-axis
Bar_Graph_H_V
needs to be set equal to the scaled y-
and
DEBUGIN
subroutine uses the
commands
value
PULSIN
needs to
and
in
x

Related parts for 28029