27220 Parallax Inc, 27220 Datasheet - Page 130

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Program: SW21-EX20-IR_Detect.BS2
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Program Description ]---------------------------------------------
'
' This program uses FREQOUT without a filter to modulate an IR LED for
' detection by a demodulating receiver.
' -----[ I/O Definitions ]-------------------------------------------------
IrLed
IrDectect
' -----[ Constants ]-------------------------------------------------------
IrMod
ModTime
NoDetect
' -----[ Variables ]-------------------------------------------------------
object
' -----[ Program Code ]----------------------------------------------------
Main:
' -----[ Subroutines ]-----------------------------------------------------
Scan_IR:
DO
LOOP
FREQOUT IrLed, ModTime, IrMod
object = IrDectect
RETURN
GOSUB Scan_IR
IF (object = NoDetect) THEN
ELSE
ENDIF
PAUSE 100
DEBUG HOME, "All clear", CLREOL
DEBUG HOME, "Intruder Alert!", CLREOL
PIN
PIN
CON
CON
CON
VAR
0
1
38500
1
1
Bit
' IR LED output
' detector input
' 38.5 kHz (harmonic)
' 1 ms
' detector is active-low
' module IR LED
' scan detector

Related parts for 27220