28017 Parallax Inc, 28017 Datasheet - Page 9

KIT DEMO ACCELEROMETER MEMSIC

28017

Manufacturer Part Number
28017
Description
KIT DEMO ACCELEROMETER MEMSIC
Manufacturer
Parallax Inc
Series
BASIC Stamp®r
Datasheet

Specifications of 28017

Sensor Type
Accelerometer, 2 Axis
Sensing Range
±2g
Interface
I²C
Sensitivity
512 counts/g
Voltage - Supply
2.7 V ~ 5.25 V
Embedded
No
Utilized Ic / Part
BASIC Stamp® or Javelin Modules
Product
Microcontroller Accessories
Flash
512 KB
Timers
10 x 8 bit
Operating Supply Voltage
5 V
Board Size
69.34 mm x 46.99 mm x 21.84 mm
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
xCal
yCal
xMove
yMove
xDiff
yDiff
moTimer
' -----[ Initialization ]--------------------------------------------------
Initialize:
Read_Cal_Values:
' -----[ Program Code ]----------------------------------------------------
Main:
' -----[ Subroutines ]-----------------------------------------------------
' Sample and filter inputs
Get_Data:
' Blink Alarm LED
' -- will run until BASIC Stamp is reset
© Parallax, Inc. • Memsic 2125 Accelerometer Demo Kit (#28017) • 09/2004
LOW AlarmLED
moTimer = 0
PULSIN Xin, HiPulse, xCal
PULSIN Yin, HiPulse, yCal
xCal = xCal / 10
yCal = yCal / 10
HIGH ResetLED
PAUSE 1000
LOW ResetLED
DO
LOOP
END
PULSIN Xin, HiPulse, xMove
PULSIN Yin, HiPulse, yMove
xMove = xMove / 10
yMove = yMove / 10
PAUSE SampleDelay
RETURN
GOSUB Get_Data
xDiff = ABS (xMove - xCal)
yDiff = ABS (yMove - yCal)
IF (xDiff > XLimit) OR (yDiff > YLimit) THEN
ELSE
ENDIF
moTimer = moTimer + 1
IF (moTimer > AlarmLevel) THEN Alarm_On
moTimer = 0
VAR
VAR
VAR
VAR
VAR
VAR
VAR
Word
Word
Word
Word
Word
Word
Word
' x calibration value
' y calibration value
' x sample
' y sample
' x axis difference
' y axis difference
' motion timer
' alarm off
' clear motion timer
' read calibration values
' filter for noise & temp
' show reset complete
' read inputs
' check for motion
' update motion timer
' clear motion timer
' take first reading
' filter for noise & temp
9

Related parts for 28017