28029 Parallax Inc, 28029 Datasheet - Page 174

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 162 · Smart Sensors and Applications
Add these variables to the Variables Section:
angleMem
difference
alarmArm
Modify the last
SEROUT 14, 84, [128, "Alarm Angle Set ",
Modify the main routine as shown here:
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
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, [154, "
IF PushButton = 1 THEN
ENDIF
difference = ABS(angle - angleMem)
IF alarmArm = 1 THEN
ENDIF
PAUSE 150
angleMem = angle
alarmArm = 1
FREQOUT speaker, 20, 3000
SEROUT 14, 84, [148,"ON " ]
SEROUT 14, 84, [160, "
IF difference > 5 AND difference < 355 THEN
ENDIF
FREQOUT speaker, 10, 4000
SEROUT
148, "OFF
VAR
VAR
VAR
command in the initialization routine:
Word
Word
Bit
", 154, DEC angle, 7]
", 160, DEC angleMem, 7]
"]
' 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
' Static characters

Related parts for 28029