28029 Parallax Inc, 28029 Datasheet - Page 169

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
SEROUT 14, 84, [129, "Heading...",
' -----[ Main Routine ]-------------------------------------------------------
DO
LOOP
' -----[ Subroutine - Compass_Get_Axes ]--------------------------------------
Compass_Get_Axes:
GOSUB Compass_Get_Axes
angle = x ATN -y
angle = angle */ 361
' LCD Display heading in degrees on top line and x and y
' measurements on the bottom line.
SEROUT 14, 84, [139, "
PAUSE 150
HIGH En: LOW En
SHIFTOUT DinDout,clk,MSBFIRST,[Reset\4]
HIGH En: LOW En
SHIFTOUT DinDout,clk,MSBFIRST,[Measure\4]
status = 0
DO
LOOP UNTIL status = Ready
SHIFTIN
HIGH En
IF (y.BIT10 = 1) THEN y = y | NegMask
IF (x.BIT10 = 1) THEN x = x | NegMask
RETURN
HIGH En: LOW En
SHIFTOUT DinDout,clk,MSBFIRST,[Report\4]
SHIFTIN
DinDout,clk,MSBPOST,[x\11,y\11]
DinDout,clk,MSBPOST,[Status\4]
149, "x=",
158, "y="]
151, "
160, "
", 151, SDEC X,
", 160, SDEC y]
", 139, DEC angle, 7,
Chapter 4: Hitachi HM55B Compass Module · Page 157
' Static characters
' Main loop
' Get x, and y values
' Convert x and y to brads
' Convert brads to degrees
' Debug delay for slower PCs
' Repeat main loop
' Compass module subroutine
' Send reset command to HM55B
' HM55B start measurement command
' Clear previous status flags
' Status flag checking loop
' Measurement status command
' Get Status
' Exit loop when status is ready
' Get x & y axis values
' Disable module
' Store 11-bits as signed word
' Repeat for other axis

Related parts for 28029