Bob Champagne
New Member
After reading countless pages on this wonderful forum and asking for help, I have completed several simple projects. But now I stumble on a trivial problem with a solution I think so simple that I can't see it... I'm making an alarm system for a cottage on a remote location. Among other things there will be a magnetic sensor connected to a door. When the door is opened the NC circuit is broken and a signal is send to the Picaxe that is connected to a relay and a siren. After a couple of minutes the siren will shut off. Now if the door is left open for days no more siren and that's OK.
But if the door is closed and the NC circuit is reactivated, I want the siren to sound again if the door is reopened. For that part, I have tried every combinations of if and then and do and loop I could think off with no success. The answer is probably obvious for the majority of you but my old brains can't figure it out. So if someone could steer me in the right direction, I would greatly appreciate. Thanks in advance, Bob.
Her's the closest I came:
But if the door is closed and the NC circuit is reactivated, I want the siren to sound again if the door is reopened. For that part, I have tried every combinations of if and then and do and loop I could think off with no success. The answer is probably obvious for the majority of you but my old brains can't figure it out. So if someone could steer me in the right direction, I would greatly appreciate. Thanks in advance, Bob.
Her's the closest I came:
Code:
start1:
if pin3=0 then HIGH 2
endif
pause 5000
LOW 2
goto flash
flash:
do UNTIL pin3=1
LOOP
goto start1
Last edited: