Not quite, but close. Instead of changing the if-statement conditions, just move the motion logic inside the if-statement:
The first time you move your hand near the sensor, buffer will be set to 1. After that, only the "else" part of the if-statement will execute, which turns off the buzzer.
A snooze feature is fairly simple. But how will you activate it? You need will need a second input of some kind.
Code:
if ( (clkmin==alarmMin) && (clkhrs==alarmHrs) && (buffer==0) )
{
buzzer=1;
if (motion==1)
{
buffer=1;
}
}
else
{
buzzer=0
}
A snooze feature is fairly simple. But how will you activate it? You need will need a second input of some kind.
Last edited: