Help with wavemaker function

Do you have a question on how to do something.
Ask in here.
Post Reply
symon_say
Posts: 118
Joined: Sun Oct 09, 2011 6:04 am
Location: Dominican Republic
Contact:

Help with wavemaker function

Post 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??
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Help with wavemaker function

Post 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
}
Last edited by binder on Sat Mar 10, 2012 7:01 pm, edited 1 time in total.
Reason: Removed bad example
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with wavemaker function

Post 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
Roberto.
symon_say
Posts: 118
Joined: Sun Oct 09, 2011 6:04 am
Location: Dominican Republic
Contact:

Re: Help with wavemaker function

Post 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??
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with wavemaker function

Post by rimai »

yeah, it is in seconds.
So, just use 1800 and 7200
Roberto.
symon_say
Posts: 118
Joined: Sun Oct 09, 2011 6:04 am
Location: Dominican Republic
Contact:

Re: Help with wavemaker function

Post 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??
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with wavemaker function

Post 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.
Roberto.
symon_say
Posts: 118
Joined: Sun Oct 09, 2011 6:04 am
Location: Dominican Republic
Contact:

Re: Help with wavemaker function

Post by symon_say »

Thanks, i already did, this controller have bring a new meaning to my reef tank, really nice.
Image
Post Reply