I am trying to set a 10min delay on a resume from power outage on my topoff port 3 on main relay box . Meaning would like for port 3 to wait 10 minutes before resuming normal operation after a power outage. This is the part of code I am talking about:
if (ReefAngel.HighATO.IsActive())
ReefAngel.SingleATO( true,Port3,60,1 );
else
ReefAngel.Relay.Off( Port3 );
I have read through the forums and seen where similar is being done with say a skimmer resuming from a power outage and / or feeding mode i.e. delayed start. Any help with how I might add just a simple delay for only this port would be highly appreciated.......
Delay on power up ?
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Delay on power up ?
ReefAngel.Relay.DelayedOn(Port3, 10);
This will delay port 3 for 10 min after a controller restart
This will delay port 3 for 10 min after a controller restart
Delay on power up ?
That will not work with the ato port..
That's like having the port be On and DelayedOn at the same time..
We have some code in another thread for delaying devices after power outage that you will probably need to implement.
That's like having the port be On and DelayedOn at the same time..
We have some code in another thread for delaying devices after power outage that you will probably need to implement.
- DrewPalmer04
- Posts: 818
- Joined: Tue May 29, 2012 2:12 pm
- Location: Christopher, IL
Re: Delay on power up ?
Ah. Didn't understand the question. Yeah it won't work for that.
Re: Delay on power up ?
Maybe something like this:
Code: Select all
bool atoSpanReached; //flag to determine if the controller has been running long enough to start ATO functionality
void setup()
{
...
}
void loop()
{
...
if(!atoSpanReached)
{
if(millis() >= 600000) //Has program been running for 10 minutes?
atoSpanReached = true; //It has so the set the flag
}
if(atoSpanReached) //Only run the ATO operations if the flag has been set
{
if (ReefAngel.HighATO.IsActive())
ReefAngel.SingleATO( true,Port3,60,1 );
else
ReefAngel.Relay.Off( Port3 );
}
}