how do i modify what i have here?
Code: Select all
if (ReefAngel.LowATO.IsActive())
ReefAngel.DosingPumpRepeat(Port7,0,30,300);
else
ReefAngel.Relay.Off(Port7);
Code: Select all
if (ReefAngel.LowATO.IsActive())
ReefAngel.DosingPumpRepeat(Port7,0,30,300);
else
ReefAngel.Relay.Off(Port7);
Code: Select all
unsigned long LastUpdate1=0;
Code: Select all
if (ReefAngel.LowATO.IsActive() && LastUpdate1==0)
{
LastUpdate1 = now();
ReefAngel.Relay.On (Port7);
}
if (now() - LastUpdate1 >= 300 && LastUpdate1 != 0)
{
LastUpdate1 = 0;
ReefAngel.Relay.Off (Port7);
}
cosmith71 wrote:Something like this? Note, this compiles, but I haven't tested it.
Put this up in globals:
And this in your loop in place of whatever line you're using for topoff.Code: Select all
static time_t LastATO=millis(); // For de-bounced ATO
Replace the two 98's and the 100 with whatever your desired low and high levels are.Code: Select all
// ******************* Debounced ATO code. Activate ATO no more than every 30 seconds. ******************* if (ReefAngel.WaterLevel.GetLevel(0) < 98) LastATO=millis(); // Start a timer if (millis()-LastATO<30000 && millis()-LastATO>10) // Has it been less than 30,000 ms? (30 secs) ReefAngel.Relay.Off(TopOff); // If so, make sure the topoff pump is off else ReefAngel.WaterLevelATO( ATO_Pump,720,34,36 ); // Otherwise, use the normal topoff routine.
--Colin
Code: Select all
static time_t LastATO=millis(); // For de-bounced ATO
Code: Select all
// ******************* Debounced ATO code. Activate ATO no more than every 60 seconds. *******************
if (!ReefAngel.LowATO.IsActive()) LastATO=millis(); // Start a timer
if (millis()-LastATO<60000 && millis()-LastATO>10) // Has it been less than 60,000 ms? (60 secs)
ReefAngel.Relay.Off(TopOff); // If so, make sure the topoff pump is off
else
ReefAngel.SingleATOLow(TopOff); // Otherwise, use the normal topoff routine.