Page 1 of 1

DelayedOn issue

Posted: Thu Feb 02, 2012 8:22 pm
by aranax
Hey guys,
I just updated my libs so I can use the DelayedOn function.

I want to:
Delay Skimmer by 1 minute (Port5) coming out of any mode (water change, feeding, etc.) - does not work
Delay Return Pump (Port1) if ATO status changes (I'm using 1 ATO switch for overflow protection) - WORKS

Note - Return pump delays about 1 minute coming out of feeding mode - I don't want it to do this.

I used the following lines in my sketch (partial sketch below).

Code: Select all

    ReefAngel.WaterChangePorts = B11111111;   
    ReefAngel.FeedingModePorts = B00110001;
    ReefAngel.OverheatShutoffPorts = B00001100;
    ReefAngel.LightsOnPorts = B11000000;

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port2);
    //ReefAngel.Relay.On(Port5);

}

void loop()
{
    ReefAngel.ShowInterface();
    wdt_reset();
    // Specific functions
    ReefAngel.StandardHeater(Port3);
    //ReefAngel.StandardHeater(Port4);
    ReefAngel.Relay.DelayedOn(Port5,1);
    //ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardLights(Port4);
    ReefAngel.MHLights(Port8);


    if(ReefAngel.HighATO.IsActive())
    {
        ReefAngel.Relay.DelayedOn(Port1,1);
    }
    else
    {
        ReefAngel.Relay.Off(Port1);
    }

Re: DelayedOn issue

Posted: Thu Feb 02, 2012 8:33 pm
by aranax
I found the issue for this:

Delay Skimmer by 1 minute (Port5) coming out of any mode (water change, feeding, etc.) - does not work. FIXED NOW. but...

Note - Return pump delays about 1 minute coming out of feeding mode - I don't want it to do this.

Can someone please help me? Thanks.

Jem

Re: DelayedOn issue

Posted: Fri Feb 03, 2012 8:36 am
by binder
Your return pump will delay by 1 minute when coming out of the mode because you have it classified as a DelayedOn port. It doesn't matter that the delay is handled with a switch statement or not. If DelayedOn gets called on a port, it gets put into the list of ports to be DelayedOn whenever the modes are exited and the port was toggled off.

So, if you want it to be delayed when the ATO high switch is active, then you need to handle it differently somehow. You may want to remove it from a port being toggled off in the modes.