28029 Parallax Inc, 28029 Datasheet - Page 146

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 134 · Smart Sensors and Applications
' south, then west.
' axis and stores that average in the EEPROM area reserved by the
' CompassOffsets DATA directive.
Get_And_Store_Axis_Offsets:
' -----[ Subroutine - Get_And_Store_Interpolation ]---------------------
' FOR...NEXT loop repeats for four axis measurements.
FOR counter = 0 TO 3
NEXT
RETURN
' Instruct user to point compass to a particular direction, then wait
' for ENTER character.
DEBUG CR, "Point compass to "
LOOKUP counter, [ 0, 90, 180, 270 ], integer
DEBUG DEC integer
DEBUG " degrees", CR, "then press Enter..."
DEBUGIN character
GOSUB Compass_Get_Axes
' Calculate offsets based on max and min values for each axis, then store
' in EEPROM.
SELECT counter
ENDSELECT
CASE 0
CASE 1
CASE 2
CASE 3
temp(0) = x
temp(1) = y
x = x + temp(0)
IF x.BIT15 = 1 THEN
ELSE
ENDIF
WRITE CompassOffsets, Word x
y = y + temp(1)
IF Y.BIT15 = 1 THEN
ELSE
ENDIF
WRITE CompassOffsets + 2, Word y
x = ABS(x)/2
x = -x
x = x / 2
y = ABS(y)/2
y = - y
y = x / 2
It then averages the maximum and minimum values for each
' Get axis measurements
' North
' East
' South
' West

Related parts for 28029