gfvalvo:
The way you wrote your conditional statements actually already implemented a hysteresis -- of sorts. I'd expand on that.
kenwood120s:
So say it starts at 22. All good, but it's warming up. Passes 23, 24. Gets to 25, fan on. Might get to 26 before fan does any good. Starts cooling, 25, fan stays on, passes 24, still on. Gets to 23, fan off. Rinse and repeat.
So this is what you mean of sorts, i've given myself a 4# space gap, it might want to be less or more i'm not to sure yet. Will the code not get confused when between a #, say 30 as it doesn't have an action or a piece of code for this or will it just keep going until another action/criteria has been met, i presume the latter. But i'm now thinking what if the temp jumped from 24 to 30, am i right in thinking that it will not to anything until it then hits 32. Sorry just trying to cover all bases here and is it the case of lesser of two evils without writting lots and lots of code. The project is just for a vivarium, the numbers i'm using atm is just for easy testing.
if (t > 32 || h > 72 ) {
digitalWrite(Relay1, LOW);
}
else if (t < 28 || h < 68 ) {
digitalWrite(Relay1, HIGH);
}
gfvalvo:
Regarding cross posting in different threads -- that practice is definitely discouraged in these forums.
Yes i take a slap on the wrists for that one, after i looked at then changing the title but there is no edit for this.
Regards