Copyright © Parallax Inc. Page 4 of 6
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Warming up..."
PAUSE 20000 ' PIR warm-up time
DEBUG CLS
DO
DEBUG HOME, "IN0 = ", BIN1 IN0 ' Display state of PIR sensor
PAUSE 100 ' Small Delay
LOOP ' Repeat Forever
Note: When this program is run, the BASIC Stamp Debug Terminal will automatically open.
Propeller BOE and Propeller QuickStart
Propeller BOE Wiring Diagram
Propeller QuickStart Wiring Diagram
OBJ
pst : "Parallax Serial Terminal" ' Use Serial Terminal object
CON
_clkmode = xtal1 + pll16x ' Set clock mode
_xinfreq = 5_000_000
VAR
byte state ' Variable for storing PIR output
PUB PIR
dira[0]~ ' Set pin 0 to input