Delay a port turn on after feeding mode

Do you have a question on how to do something.
Ask in here.

Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX
PostPosted: Sat May 03, 2014 1:30 pm
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

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Mon May 05, 2014 8:10 am
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.

Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX
PostPosted: Mon May 05, 2014 11:35 am
Thank you, will try it when I get home tonight.
Image

Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX
PostPosted: Thu May 15, 2014 5:36 pm
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

Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX
PostPosted: Thu May 15, 2014 5:39 pm
Nevermind, didn't realize you had Delayed start in the Wizard.

Code: Select all
ReefAngel.Relay.DelayedOn( Port7,3 );
Image

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 4 guests

cron