28029 Parallax Inc, 28029 Datasheet - Page 110

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 98 · Smart Sensors and Applications
To reverse the angle of rotation the that program displays, all you have to do is use −Ay
instead of A
counterclockwise, A
arctangent of −A
Figure 3-25: Reversing Direction of Rotation with -Ay
This change is easy to make in the program. Simply insert a negative sign before the y in
angle = x ATN y
ACTIVITY #6: MEASURE TILT FROM THE HORIZONTAL
This activity measures how far the Board of Education is tilted from the horizontal.
Figure 3-26 shows the Board of Education with the Memsic Accelerometer on the
breadboard. The accelerometer's acceleration-sensing axes (x
top and left of the Board of Education. This activity develops a program that displays the
tilt angle for each axis. When the board is held level, the tilt angle is 0° for both the x
an y
tilt angle for the y-axis. If you tilt it so that y
angle. The same applies for x
tilt angle. If you tilt the board towards one of its corners, the program will report tilt for
both the x
tan
tan
m
1
1
⎛ −
⎛ −
⎜ ⎜
axes. If you tilt the board so that y
Save VertWheelRotation.bs2 as VertWheelRotationCounterclockwise.bs2
Change
Run the program and verify that the rotation angle now increases as you rotate
the board counterclockwise.
A
Ax
A
Ay
m
X
Y
and y
⎟ ⎟
y
=
=
.
tan
tan
angle = x ATN y
y
m
/A
Take a look at Figure 3-25.
.
axes.
x
y
, the result is 30°.
1
1
⎜ ⎜
⎜ ⎜
is −1/2, and the arctangent turns out to be 330°. By taking the
2
2
2
1
1
3
3
2
⎟ ⎟
⎟ ⎟
=
=
m
330
30
; point it up for a positive tilt angle or down for a negative
°
°
to
angle = x ATN −y
m
points up, the program will report a positive
m
points down, it will report a negative tilt
If you rotate the accelerometer
.
m
and y
m
) point toward the
m

Related parts for 28029