PIR Motion Sensor with Piezo Buzzer and LEDs
uzi
Posts: 4
I am trying to program a PIR motion sensor that will sense motion and turn on a piezo buzzer and LED light that are all connected on a Parallax Propeller. The code is written in C and used on Simple IDE. The code works to where the motion is sensed and turns on the buzzer and LED but I can't turn it off unless I unplug the circuit. I was thinking of adding a push button that will turn it off and reset it to the previous state. Any advice?
txt
948B
Comments
It compiles but I don't have your setup created to try it out.
Mike
Since the code that "iseries" provided was closer to what I think you want, I added the appropriate changes to it to implement a push-button to reset(turn-off) an active alarm. The code below compiles, but I haven't tested it on any hardware. Take a look at it and give it a try. Let us know how it goes...
Just remove the freqout(BUZZER, 0, 1000);
Mike
Glad to hear it worked...