Page 1 of 1
Help with wavemaker function
Posted: Sat Mar 10, 2012 5:22 pm
by symon_say
Hi
I having playing with my reef angel for a few days, and it was a lot easier than i think it was gonna be, but one thing i can find on RAGen and i don't know how to do it, is the the wavemaker funtion on the menu with the possibility of changing time between pumps, and if they turn on together or one after the other.
I have 4 powerheads in my tank, i want to have to always on, those are connected outside of RA, and the other 2 i want then to cycle for 1 hr one, and then the other, and i want to add to the menu the option that the demo had of the wave maker to change time between cycles and how they turn on.
How can i add this menu option and the ability to the pump on from 1/2 to 2 hrs??
Re: Help with wavemaker function
Posted: Sat Mar 10, 2012 6:11 pm
by binder
If you are running the SIMPLE_MENU (which is the default with RAGen), then you cannot add the setup screens. If you want the setup screens, you will have to uncheck Simple Menu from the Features tab inside RAGen and press Save. Then re-upload your software. Use caution as the code size will increase a lot.
The default wavemaker function does not toggle one port on and the other off at the same time. It functions as toggling the port on and off at a specified interval. If you want to run one port for 120 minutes (2 hours) and have the other off during that time, then toggle the ports on/off, you must manually code that functionality in.
Here is an example for you. It starts with port 6 ON and port 5 OFF. It uses the internal memory location for Wavemaker 1 to contain the toggle interval. After the interval is reached, it toggles Port 6 and Port 5. So only one will be active at a time.
Code: Select all
void setup()
{
// .... other code here
ReefAngel.Timer[1].SetInterval(InternalMemory.WM1Timer_read());
ReefAngel.Timer[1].Start();
ReefAngel.Relay.On(Port6);
}
void loop()
{
// .... other code here
// toggle wavemakers
if ( ReefAngel.Timer[1].IsTriggered() )
{
ReefAngel.Timer[1].Start();
ReefAngel.Relay.Toggle(Port6);
ReefAngel.Relay.Toggle(Port5);
}
// ... other code here
}
Re: Help with wavemaker function
Posted: Sat Mar 10, 2012 6:48 pm
by rimai
You can also take a look at one of the example codes, for another way of doing.
On Arduino, go to File->Sketchbook->Example Codes
Re: Help with wavemaker function
Posted: Sun Mar 11, 2012 9:10 pm
by symon_say
I like what the example have, can i change the values from the example wavemaker_random from 15-60 seg to 30-120 min??
What part of the code i have to add to my existing code and were to place it??
Re: Help with wavemaker function
Posted: Sun Mar 11, 2012 9:41 pm
by rimai
yeah, it is in seconds.
So, just use 1800 and 7200
Re: Help with wavemaker function
Posted: Sun Mar 11, 2012 10:40 pm
by symon_say
do i have to load all the code from the example or just a part?? and if its a part, were in my existing code should i put it??
Re: Help with wavemaker function
Posted: Mon Mar 12, 2012 8:24 am
by rimai
Code: Select all
ReefAngel.WavemakerRandom1(Port5,1800,7200); // Turn Port5 on/off random cycles that lasts from 15 to 60 secs
ReefAngel.WavemakerRandom2(Port6,1800,7200); // Turn Port6 on/off random cycles that lasts from 15 to 60 secs
// Port 5 and 6 are not synchronized.
// They work independent of each other at random times.
You can add these to your loop() section of your own INO code.
Re: Help with wavemaker function
Posted: Mon Mar 12, 2012 1:34 pm
by symon_say
Thanks, i already did, this controller have bring a new meaning to my reef tank, really nice.