Time t;
#define buz 11 //This is Buzzer that is plug into pin 11 (Change it accordingly to what you will be putting it in the arduino)
int Hor; // This is declaring the alarm in Hours
int Min; // This is declaring the alarm in Minutes
int Sec; // This is declaring the alarm in Seconds
const int sensor = 10; // Door sensor connected to Pin 10
int state; // 0 close - 1 open switch
How many of these need to be global?
else{ //Once user open the door sensor, the alarm will stop buzzing
noTone(buz);
}
That comment is wrong. You do NOT want to use an else here. You want to turn the buzzer off if it is before 19:06 (it shouldn't be on), if it is after 19:08, OR if the door is open.
I assume that the comment associated with the uselessly-named state variable means that it is supposed to hold the state of a switch that is pressed when the door is closed.
But, nowhere do you actually read the state of the pin that the switch is connected to, if there is such a switch, so it is pointless to talk about shutting the noise off when the door is closed.