28029 Parallax Inc, 28029 Datasheet - Page 76
28029
Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet
1.122-28029.pdf
(340 pages)
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
- Current page: 76 of 340
- Download datasheet (5Mb)
Page 64 · Smart Sensors and Applications
P2. Example solution:
LOOP
' Smart Sensors and Applications - Ch2_Project2.bs2
' Make a sound when someone passes through the doorway.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]---------------------------------------------
Ping
Speaker
' -----[ Constants ]---------------------------------------------------
InConstant
Doorjamb
' -----[ Variables ]---------------------------------------------------
inDistance
time
counter
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
' -----[ Subroutines ] ------------------------------------------------
Read_Ping:
Sound_Alarm:
Calc_Distance:
PULSIN 15, 1, time
cmDistance = cmConstant ** time
SEROUT LCD, 84, [128, DEC3 cmDistance, " cm"]
IF cmDistance >= MaxDistance THEN HIGH LED
PAUSE 100
GOSUB Read_Ping
GOSUB Calc_Distance
IF (inDistance < Doorjamb) THEN
ENDIF
PULSOUT 15, 5
PULSIN 15, 1, time
RETURN
FREQOUT Speaker, 300, 3300
PAUSE 50
FREQOUT Speaker, 450, 2200
RETURN
inDistance = inConstant ** time
RETURN
GOSUB Sound_Alarm
PIN
PIN
CON
CON
VAR
VAR
VAR
15
9
890
35
Word
Word
Nib
' Read echo time
' Calculate distance from time
' Parallax Ping))) sensor
' Optional speaker
' Doorway width is 35 inches
' Round trip echo time
' Start Ping)))
' Read echo time
' Bing
' Bong
' These are the whole measurements
' Print distance on
' LCD scrn
' Toggle LED if out
' of range
Related parts for 28029
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: