Wednesday, April 16, 2008

motion sensor to recording module

we can get the motion sensor to activate the recording button, however we can't playback the recording while the circuit to the recording switch is closed. to be continued...

-----[ Program Description ]---------------------------------------------
' This PIR demo allows you to see how to go about allowing a warm-up time' for the sensor to settle, as well as displayed number of times tripped' and possibly activating an alarm or relay, in this case the LED. The LED' should have a 220 ohm or 330 ohm resistor in series with it.
' -----[ I/O Definitions ]-------------------------------------------------
PIR PIN 15 ' I/O Pin For PIR SensorLED PIN 3 ' I/O Pin For LED
' -----[ Variables ]-------------------------------------------------------
counter VAR Byte ' Trip Counter
' -----[ Initialization ]--------------------------------------------------
DEBUG CLS ' Clear DEBUG ScreenFOR counter = 40 TO 0 ' Wait 40 Seconds For PIR Warm-Up DEBUG HOME, "WARMING UP:", DEC2 counter PAUSE 1000 ' Display Counter Every SecondNEXT
counter = 0 ' Clear Counter Variable
DEBUG HOME, "WAITING... " ' Display Waiting Message
' -----[ Program Code ]----------------------------------------------------
MAIN: DO IF PIR = 1 THEN ' Motion Detected? counter = counter + 1 ' Update Trip Counter HIGH LED ' Light LED DEBUG HOME, "TRIPPED...", DEC3 counter PAUSE 20000 DO : LOOP UNTIL PIR = 0 ' Wait For PIR To Clear DEBUG HOME, "CLEARED...", DEC3 counter LOW LED ' Turn Off LED ENDIF LOOP

Labels:


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?