28029 Parallax Inc, 28029 Datasheet - Page 175

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
' -----[ Title ]--------------------------------------------------------------
' Smart Sensors and Applications - Ch4_Project2.bs2
' Display digital compass and tilt measurements with one program.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Constants ]----------------------------------------------------------
Negative
Positive
' -----[ I/O Definitions ]----------------------------------------------------
DinDout
Clk
En
Reset
Measure
Report
Ready
NegMask
' -----[ Variables ]----------------------------------------------------------
xTilt
yTilt
side
angleTilt
sign
xCompass
yCompass
status
angleCompass
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS
' -----[ Main Routine ]-------------------------------------------------------
DO
P2. Example solution: Ch4_Project2.bs2
This program is a combination of HorizontalTilt.bs2 and TestCompass.bs2.
CON
CON
PIN
PIN
PIN
CON
CON
CON
CON
CON
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
1
0
Word
Word
Word
Word
Bit
2
0
1
%0000
%1000
%1100
%1100
%1111100000000000
Word
Word
Nib
Word
Chapter 4: Hitachi HM55B Compass Module · Page 163
' BASIC Stamp Directive
' PBASIC Directive
' Sign - .bit15 of Word variables
' P2 transceives to/from Din/Dout
' P0 sends pulses to HM55B's Clk
' P2 controls HM55B's /EN(ABLE)
' Reset command for HM55B
' Start measurement command
' Get status/axis values command
' 11 -> Done, 00 -> no errors
' For 11-bit negative to 16-bits
' Memsic x-axis measurement
' Memsic y-axis measurement
' trig subroutine variable
' result angle - degrees
' Sign bit
' x-axis data
' y-axis data
' Status flags
' Store angle measurement
' Clear Debug Terminal

Related parts for 28029