Hi,
I would like to have an automatic clearing of the Overheat status, if the temperature has decreased of a given amount (e.g. 3 degrees). This would guarantee that the system is reset if conditions are OK, even if I am not able to connect to internet from remote.
Can anyone check if this code would do? Thanks.
void CustomOverheatClear(byte probe)
{
if((bitRead(ReefAngel.AlertFlags, OverheatFlag)) && (ReefAngel.Params.Temp[probe] <= InternalMemory.OverheatTemp_read()-3.0))
ReefAngel.OverheatClear();
}
loop()
{
//...
CustomOverheatClear(T1_PROBE);
//..
}
Overheat automatic clearing
-
marcoc
- Posts: 18
- Joined: Sat Dec 05, 2015 3:24 pm
- Location: Rome, Italy
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Overheat automatic clearing
That should work except i think you'd want it to be 30 in order to be 3.0 as temp is stored as a byte value * 10
-
marcoc
- Posts: 18
- Joined: Sat Dec 05, 2015 3:24 pm
- Location: Rome, Italy
Re: Overheat automatic clearing
Thanks. Just one more question:
the definition
void CustomOverheatClear(byte probe)
{
if((bitRead(ReefAngel.AlertFlags, OverheatFlag)) && (ReefAngel.Params.Temp[probe] <= InternalMemory.OverheatTemp_read()-30))
ReefAngel.OverheatClear();
}
goes within the global variables or in the setup() ?
Thanks again.
the definition
void CustomOverheatClear(byte probe)
{
if((bitRead(ReefAngel.AlertFlags, OverheatFlag)) && (ReefAngel.Params.Temp[probe] <= InternalMemory.OverheatTemp_read()-30))
ReefAngel.OverheatClear();
}
goes within the global variables or in the setup() ?
Thanks again.
- lnevo
- Posts: 5422
- Joined: Fri Jul 20, 2012 9:42 am
Re: Overheat automatic clearing
can't have a function within a function. It goes outside of the setup and loop and then you would call it when appropriate.