Delay a port turn on after feeding mode

Do you have a question on how to do something.
Ask in here.
Post Reply
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Delay a port turn on after feeding mode

Post 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
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay a port turn on after feeding mode

Post 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)
Roberto.
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Re: Delay a port turn on after feeding mode

Post by ReEfnWrX »

Thank you, will try it when I get home tonight.
Image
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Re: Delay a port turn on after feeding mode

Post 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?
Image
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Re: Delay a port turn on after feeding mode

Post by ReEfnWrX »

Nevermind, didn't realize you had Delayed start in the Wizard.

Code: Select all

ReefAngel.Relay.DelayedOn( Port7,3 );
Image
Post Reply