Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- XB_Rx = 5 ' XBee DOUT
- XB_Tx = 6 ' XBee DIN
- XB_Baud = 9600
- CR = 13 ' Carriage Return value
- VAR
- byte state ' Variable for storing PIR output
- OBJ
- XB : "FullDuplexSerial"
- Pub Start
- XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee
- dira[0]~ ' Pins 0 to input
- XB.str(string("Warming Up..."))
- waitcnt(clkfreq * 20 + cnt) ' PIR "warm-up" time
- repeat
- state := ina[0] ' Save state of PIR Sensor
- XB.str(string("PIR = "))
- XB.dec(state) ' Display results
- XB.Tx(CR)
- waitcnt(clkfreq/200 + cnt) ' Small delay)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement