Delay on power up ?

Do you have a question on how to do something.
Ask in here.
Post Reply
CASPAR
Posts: 49
Joined: Wed May 09, 2012 12:24 pm

Delay on power up ?

Post by CASPAR »

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.......
Image
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Delay on power up ?

Post by DrewPalmer04 »

ReefAngel.Relay.DelayedOn(Port3, 10);

This will delay port 3 for 10 min after a controller restart
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Delay on power up ?

Post by lnevo »

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.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Delay on power up ?

Post by DrewPalmer04 »

Ah. Didn't understand the question. Yeah it won't work for that.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
dmolton
Posts: 182
Joined: Tue Mar 22, 2011 11:08 am

Re: Delay on power up ?

Post by dmolton »

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 );
  }
}

Post Reply