I have code that is monitoring the output of a PIR sensor.
The code counts the number of triggers before sounding an alarm bell.
My problem is knowing how to add code to sensibly include a time period where the incrementing B4 gets reset, (i.e it could increment over days to reach it's limit) maybe resetting every 10 minutes of no activity.
Any help/advice appreciated
The code counts the number of triggers before sounding an alarm bell.
My problem is knowing how to add code to sensibly include a time period where the incrementing B4 gets reset, (i.e it could increment over days to reach it's limit) maybe resetting every 10 minutes of no activity.
Any help/advice appreciated
Code:
B4=0
SB:
' Monitor for PIR trigger (PIR1=1)
If PIR1=0 then ' PIR triggered
B4=B4+1
end if
IF B4=3 Then goto SOUNDBELL
pause 2000
goto sb
SOUNDBELL:
' make noise etc
END