You are using channel 2 for the pump control:
- Code: Select all
PWMValue=OperatingPWM;
if (ReefAngel.WaterLevel.GetLevel(2)<Level-4)
{
override=true;
lastmillis=millis();
PWMValue+=2;
}
if (ReefAngel.WaterLevel.GetLevel(2)>Level+2)
{
override=true;
lastmillis=millis();
PWMValue-=4;
}
And then the same channel for overfow control:
- Code: Select all
if (ReefAngel.WaterLevel.GetLevel(2)>89) //Overflow
ReefAngel.Relay.Off(Port1);
else
ReefAngel.Relay.On(Port1);
So effectively, your first code does nothing.
The second code supersedes and then you will only get port1 off when level is greater than 89.