28029 Parallax Inc, 28029 Datasheet - Page 160

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 148 · Smart Sensors and Applications
Your Turn - Averaging the Calibration and Calibration Test Programs
The calibration and test calibration programs significantly improve the accuracy of your
digital compass. By incorporating averaging into both programs, the accuracy of your
digital compass will be further improved.
ACTIVITY #5: MOBILE MEASUREMENTS
This activity demonstrates how to replace the Debug Terminal with the Parallax Serial
LCD to make your digital compass mobile.
Connecting the Parallax Serial LCD with an Extension Cable
The Parallax Serial LCD is a definite source of magnetic field disturbance and needs to
be operated well away from the compass module. This is easily done with an extension
cable.
xSum = ABS(xSum)
x = xSum / 10
IF xSum // 10 >=5 THEN x = x + 1
IF sign = Negative THEN x = - x
sign = ySum.BIT15
ySum = ABS(ySum)
y = ySum / 10
IF ySum // 10 >=5 THEN y = y + 1
IF sign = Negative THEN y = - y
RETURN
Follow the steps in this activity to incorporate averaging into a copy of
CalibrateCompass.bs2. Instead of modifying the program's
subroutine
(TestCompassAveraged.bs2) and paste it over the one in your copy of
CalibrateCompass.bs2.
Run your modified copy of CalibrateCompass.bs2 and repeat the steps in
Activity #2.
Make a copy of TestCalibratedCompass.bs2, and modify it to perform averaging.
Repeat the accuracy tests in Activity #3. Your digital compass should perform
really well now.
just
copy
the
modified
' Take absolute value
' x = the average measurement
' Fraction > .5? Round up
' if xSum negative, negate x
' Store sign of ySum
' Take absolute value
' y = the average measurement
' Fraction > .5? Round up
' if ySum negative, negate y
subroutine
from
Compass_Get_Axes
this
program

Related parts for 28029