wildbill:
This is the bit I was describing. Not complete and not compiled, so not tested.
//Globals
bool buzzing=false;
int buzzcount=0;
usigned long lastbuzz=0;
// part of loop, at the end
if ((millis() - lastlcd > setvaluelcd) && ktc.readFahrenheit() >= SetTemp)
{
buzzing=true;
buzzcount=16
digitalWrite(buzzer, HIGH);
lastbuzz=millis();
}
It's because you still have over temp, so as soon as the beeps stop, that section restarts it. When you stop beeping, note the time and don't allow a restart until a minute (or whatever) has passed.
wildbill:
It's because you still have over temp, so as soon as the beeps stop, that section restarts it. When you stop beeping, note the time and don't allow a restart until a minute (or whatever) has passed.
What do you mean? How do I make it not allow a restart until a minute has passed.
This is a more simplified version of the code using the Boolean and count. I just wanna test the concept.
Thanks.
For a simple way to see it working, add a new time interval that controls how often you check for over temp. Right now you're using setvaluelcd, add a new one. set it to thirty seconds.
wildbill:
For a simple way to see it working, add a new time interval that controls how often you check for over temp. Right now you're using setvaluelcd, add a new one. set it to thirty seconds.
I changed setvaluelcd and set it to 30 sec. Now it beeps every 30 seconds while the temp updates correctly.
The buzzer is initially off and it starts beeping only after 30 seconds have passed and then it continues to beep every 30 seconds.