28029 Parallax Inc, 28029 Datasheet - Page 119

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
With the MX2125, a measurement of 1875 is −1 g, and a measurement of 3125 is 1 g. In
Activity #3, we scaled this to a range of −127 to 127. Remember that −127 is the
equivalent of −1 for the
between −127 and 127 is the equivalent of a fraction, and coming from the MX2125, it's
actually sin θ. So, once the MX2125's measurement has been scaled to −127 to 127, all
you have to do is use the
The simplest way to write a tilt program is to start with the previous example program,
TestArcsine.bs2. Then, incorporate the accelerometer measurement and scaling and
offset commands from TestScaleOffset.bs2 and the accelerometer measurements from
VertWheelRotation.bs2. This program's Main Routine boils down to two commands for
measuring the x and y axes, two commands for scaling, and two small routines that call
the
Figure 3-32: Determining Tilt Angle with Arcsine
Arcsine
DO
PULSIN 6, 1, x
PULSIN 7, 1, y
x = (x MIN 1875 MAX 3125) - 1875 ** 13369 - 127
y = (y MIN 1875 MAX 3125) - 1875 ** 13369 - 127
subroutine and display the result.
Arcsine
Arcsine
subroutine to determine the tilt angle (the value of θ).
subroutine, and 127 is the equivalent of 1. Anything
Chapter 3: Tilt with the Memsic Accelerometer · Page 107
A
sin
sin
θ
A
g
X
=
X
θ
sin
=
=
1
=
g
(
sin
sin
A
sin
1
g
X
θ
θ
A
θ
)
g
X
=
sin
1
A
g
X

Related parts for 28029