"Entry" Level Controllable Pumps?

Talk about you and your tank/equipment

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Feb 27, 2013 9:51 am
What do you want to do?
Roberto.

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Wed Feb 27, 2013 10:06 am
rimai wrote:What do you want to do?

I would like 2 powerheads to (port 5-6) to toggle between each other at 30-180 seconds. Maybe this?

// Randomize the Timer
static time_t timer=now()+30;
if (now()>timer)
{
timer=now()+random(30, 180);
}

ReefAngel.WavemakerToggle(Port5, Port6, timer);


Would this also go where all of my standard code goes? I dont have code anywhere else that I have added.

Thanks
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Feb 27, 2013 10:29 am
Try this:
Code: Select all
ReefAngel.WavemakerRandom1(Port5,30,180);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

You can do this with the wizard too :)
Roberto.

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Wed Feb 27, 2013 10:56 am
Thanks!! This unit is killer!
Image

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Wed Feb 27, 2013 4:43 pm
if ( (hour() >=1) && (hour() <12) )
ReefAngel.Relay.Set(Port4, now()%900<120);
else
ReefAngel.Relay.Off(Port4);

Just checking if this translated to every 15min dose for 2min?
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed Feb 27, 2013 4:58 pm
Yes just keep in mind that it will be 13 minutes after the dose...if you want 15 minutes between the end of the first dose and the start of the second then you'll need to add 2 minutes to the 900...

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Thu Feb 28, 2013 6:56 am
I understand. Im still dialing it in a bit. I ran into a cycling issue with the wavemaker and my delay for the powerheads...I just removed the line for the delay and all was well.

A Few Questions
If I want to to run from 10pm to 12pm would my time look like this
((if ( (hour() <=22) && (hour() <12) )?? Was NOT sure about this.

I would also like to maybe make the wavemaker cycle at different intervals at night. Would that look like this...
//10pm-9am Wavemaker 15min-60min Random
if ( (hour() <=22) && (hour() >=9) )
ReefAngel.WavemakerRandom1(Port5,900,3600);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
else
ReefAngel.WavemakerRandom1(Port5,210,900);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

ALSO!! Would this be how to do both completely random?
ReefAngel.WavemakerRandom1(Port5);
ReefAngel.WavemakerRandom2(Port6);
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Feb 28, 2013 9:11 am
((if ( (hour() <=22) && (hour() <12) )?? Was NOT sure about this

No... && means AND, so you are asking is time is less than 22 AND less than 12... Well... That doesn't make sense, right?
It should be this:
Code: Select all
if (hour()>=22 || hour()<12)

|| means OR

Your code snippet looks good.

Yes, if you use WavemakerRandom1 and WavemakerRandom2, both are going to be completely random.
Roberto.

Posts: 278
Joined: Wed Jan 23, 2013 12:36 pm
PostPosted: Thu Feb 28, 2013 12:38 pm
Thats going to take a bit of trial and error.
Could you give a good rule of thumb as to when to use && vs. ||? Is it because Im rolling between am/pm??
It seems that most of my if/then conditionals have &&. Im sure it will make sense I just need to wrap my head around it.
Image
User avatar
Posts: 5343
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Feb 28, 2013 12:47 pm
It's basic logic statements...

AND or OR

So take an example a blue ball...

if (ball=blue) && (ball=round) then true
if (ball=blue) && (ball=cube) then false
if (ball=blue) || (ball=yellow) then true
if (ball=blue) || (ball=cube) then true

So AND both sides need to be true for the condition to work...
For OR only one side needs to be true for the conditional needs to be true.
PreviousNext

Return to You and your tank

Who is online

Users browsing this forum: No registered users and 1 guest

cron