Page 1 of 1

Delay a port turn on after feeding mode

Posted: Sat May 03, 2014 1:30 pm
by ReEfnWrX
When in feeding mode my Return Pump (Port3) turns off, it is not a DC pump so I cannot ramp it up. To speed up the air bubbles getting out of the water I have been turning off my WP40 (Port7) for a few minutes then turning it back on.

How can I code Port 7 to turn off when ever my return pump (Port3) turns on and to then turn on, 3 minutes later?

I am not trying to mask Port 3, I do not want my WP40 to turn off if port 3 is off, I want it to turn off when port 3 first turns on, and then delay start

Re: Delay a port turn on after feeding mode

Posted: Mon May 05, 2014 8:10 am
by rimai
Try this:

Code: Select all

static unsigned long lastPortOff=now()-180;
static boolean lastPortStatus=true;
if (!lastPortStatus && ReefAngel.Relay.Status(Port3))
{
  lastPortOff=now();
}
lastPortStatus=ReefAngel.Relay.Status(Port3);
ReefAngel.Relay.Set(Port7,now()-lastPortOff>180)

Re: Delay a port turn on after feeding mode

Posted: Mon May 05, 2014 11:35 am
by ReEfnWrX
Thank you, will try it when I get home tonight.

Re: Delay a port turn on after feeding mode

Posted: Thu May 15, 2014 5:36 pm
by ReEfnWrX
Roberto, it worked like a charm. I turn off port 3, when I turn it on Port 7 turns off and turns on 3 minutes later.

However, when the power is cycled and the controller turns on for the first time, Port 7 turns on with no delay. What can I do to make it delay as well during a power cycle?

Re: Delay a port turn on after feeding mode

Posted: Thu May 15, 2014 5:39 pm
by ReEfnWrX
Nevermind, didn't realize you had Delayed start in the Wizard.

Code: Select all

ReefAngel.Relay.DelayedOn( Port7,3 );