I have set up a code that keeps time in hours, minutes and seconds. I want an alarm to go off at a certain time and continue to ring until I push a switch.
The snippet of code that I am using for the alarm portion of the code is
if (h==8 && m==30 && s==0 && B==1){
do{
tone(sound,330);
}
while(B==1);
I thought that this code would cause the tone to begin and then end once the switch pin no longer read 1. This isn't the case.
I tried this too..
do{
tone(sound,330);
}
while(h==8 && m==30 && s>=0 &&s <=59 && B==1);
I'm honestly lost. Can someone help? I'm not very good with arduino so try to keep explanations elementary.