Is there any sample code or examples of using the WavemakerRandom function that maybe includes a window when it runs rather than 24x7?
I found a couple examples earlier that I am using which work great with my two Koralia 425's. However, I'm looking at my tank and it may be a bit much It is a 29 gallon Bio Cube in which case I had one before that would randomly go on and off. The same logic worked with the new one but I was looking for something a bit longer in between like high and low tide somewhat, and then shutting both off when lights go out so only the return pump goes.
Just not sure how to but a bigger time around the code thus my question. Current code below which works.
Thanks.
-scott
ReefAngel.WavemakerRandom(Port5,3600,7200);
// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// Turn Port6 on/off on opposite cycle as Port 5
WavemakerRandom function question
Re: WavemakerRandom function question
I was thinking 8 pm to 8 am they would be off to give the tank some calmer flow or something like that. Or if it is even possible to put say a sleep or wait in there so the cycle rests every hour.rimai wrote:So, when is that you want to have them off?
I just put it back to the original code I saw which was between 25 and 60 seconds to switch between the two. Everything appears to like the shorter durations better.
Side note. I just noticed the new menu. It looks nice. Thank you.
Re: WavemakerRandom function question
You can use like this:
It will turn the ports off on hour >= 20 or hour < 8
Code: Select all
if (hour()>=20 || hour()<8)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
Roberto.
Re: WavemakerRandom function question
Hi Roberto,
That seems easy enough. Is there a set place to put that bit of code? I placed it under the void loop. Didn't seem like it did much but I think I get the idea although it is in the wrong block/location.
-scottf
void loop()
{
// ReefAngel.WavemakerRandom( Port5,60,100 );
// ReefAngel.WavemakerRandom( Port6,120,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,19,0,0,90,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,21,0,0,80,0) );
////// Place your custom code below here
// This will turn off both relays at a set time
if (hour()>=20 || hour()<9)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
ReefAngel.WavemakerRandom(Port5,25,60);
// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// Turn Port6 on/off on opposite cycle as Port 5
That seems easy enough. Is there a set place to put that bit of code? I placed it under the void loop. Didn't seem like it did much but I think I get the idea although it is in the wrong block/location.
-scottf
void loop()
{
// ReefAngel.WavemakerRandom( Port5,60,100 );
// ReefAngel.WavemakerRandom( Port6,120,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,19,0,0,90,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,21,0,0,80,0) );
////// Place your custom code below here
// This will turn off both relays at a set time
if (hour()>=20 || hour()<9)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
ReefAngel.WavemakerRandom(Port5,25,60);
// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// Turn Port6 on/off on opposite cycle as Port 5
Re: WavemakerRandom function question
The part that turns the wavemakers off needs to be last..
Re: WavemakerRandom function question
void loop()
{
// ReefAngel.WavemakerRandom( Port5,60,100 );
// ReefAngel.WavemakerRandom( Port6,120,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,19,0,0,90,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,21,0,0,80,0) );
////// Place your custom code below here
ReefAngel.WavemakerRandom(Port5,25,60);
// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// Turn Port6 on/off on opposite cycle as Port 5
// This will turn off both relays at a set time
if (hour()>=20 || hour()<9)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
{
// ReefAngel.WavemakerRandom( Port5,60,100 );
// ReefAngel.WavemakerRandom( Port6,120,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,19,0,0,90,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,21,0,0,80,0) );
////// Place your custom code below here
ReefAngel.WavemakerRandom(Port5,25,60);
// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// Turn Port6 on/off on opposite cycle as Port 5
// This will turn off both relays at a set time
if (hour()>=20 || hour()<9)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
Re: WavemakerRandom function question
Thanks Lnevo and Rimai. That worked perfectly.
Simple too!
Simple too!
Re: WavemakerRandom function question
you can ignore my post in the other topic then. it's basically the same thingsaf1 wrote:Thanks Lnevo and Rimai. That worked perfectly.
Simple too!
glad you got it working
Sent from my Nexus 7
Re: WavemakerRandom function question
Thanks Binder. I forgot I actually posted there and made a new one. Bad on my part, I apologize. In hind sight the solution was easy and works great. I'm not sure if the fish are happy but the corals sure do love the back and forth change (although my golden leather and Kenya trees seem to be touching and the leather doesn't like it much).binder wrote:you can ignore my post in the other topic then. it's basically the same thingsaf1 wrote:Thanks Lnevo and Rimai. That worked perfectly.
Simple too!
glad you got it working
Sent from my Nexus 7