28029 Parallax Inc, 28029 Datasheet - Page 147

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
' This subroutine prompts the user to point the compass to directions
' separated by 22.5 degrees and stores the angle for each of the measurements
' in the EEPROM area reserved by the CompassCal DATA directive.
Get_And_Store_Interpolation:
' -----[ Subroutine - Get_And_Store_Low_Value_Address ]-----------------------
' This subroutine finds and stores the address of the lowest value in the
' EEPROM area reserved by the CompassCal DATA directive and stores it in
' a byte reserved by the CompassLowVal DATA directive.
' code overhead in TestCalibratedCompass.bs2.
Get_And_Store_Low_Value_Address:
' -----[ Subroutine - Calibration_Review ]------------------------------------
FOR counter = 0 TO 15
NEXT
RETURN
index = 8
table(current) = 0: table(previous) = 0
DO
LOOP UNTIL table(current) < table(previous)
WRITE CompassLowVal, index
RETURN
' Display EEPROM values.
Calibration_Review:
DEBUG CR, "Point compass to "
LOOKUP counter, [0,
LOOKUP counter, [ 0,
DEBUG DEC integer
IF fraction = 5 THEN DEBUG ".", DEC fraction
DEBUG " degrees", CR, "then press Enter..."
DEBUGIN character
GOSUB Compass_Get_Axes
GOSUB Compass_Correct_Offsets
angle = x ATN - y
WRITE CompassCal + counter, angle
index = index + 1
READ CompassCal + index, table(current)
READ CompassCal + (index - 1 & $F), table(previous)
180, 202, 225, 247, 270, 292, 315, 337], integer
0,
22,
5,
5,
45,
0,
0,
67,
Chapter 4: Hitachi HM55B Compass Module · Page 135
5,
5,
90, 112, 135, 157,
0,
0,
' Wait for user
' Get x, and y values
' Correct axis offsets
' Convert x and y to brads
' Store as brad value
5,
5,
0,
0,
This reduces the
5,
5 ], fraction

Related parts for 28029