Wave patterns

Related to the development libraries, released by Curt Binder
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

But I'm using those functions with my Vortech or someone may want to use it with leds or something we havent tbought of. Plus the thresholds on some jaebo is 20 something.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

Thats why doing it in the class where you can persistently define what is the threshold and doing the remapping there instead of in the global generic function.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wave patterns

Post by AlanM »

Ah, got it. I didn't realize that people were directly driving their vortech speeds with the RA. I figured you'd just tell the WES controller to flip you to a different mode with given parameters.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

I could but i could also use one of the RA modes or custom functions like ElseMode and one the bhazard did that I setup as custom functions. I can also do each channel individually letting me change which pump is sync anti sync on the fly. I also added an offset so I can change the power level of the anti sync pump.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wave patterns

Post by AlanM »

OK, so if I added in a Threshold value in DCPump.cpp (and .h of course) for each possible pump, Daylight, Actinic, LowATO, 6 Expansions, and 16 extra Expansions, I would have to look for those thresholds in the ReefAngel.cpp and constrain what the calls to the wave modes give out when calling the SetDaylight, SetChannel, etc. methods. I'd probably add a function in Globals that returns 0 or threshold->max when given a value and just call that one each time.

I understand that the values set in DCPump.DaylightChannnel are booleans that are Sync or AntiSync, so 0 or 1, and I see that each call in ReefAngel.cpp subtracts one from those values, what is the -1 for in those calls to wave modes?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

I think because sync is 1 and anti sync is 2 and therefore the -1 brings it to 0 and 1 which correspond to true/false

Btw roberto not sure bools actually save any space as i think arduino stores bools as a byte...
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wave patterns

Post by AlanM »

I submitted a pull request to include my PWM profile and also ElseMode since lots of people are using it. However, I see that in the ReefAngel.cpp there is a switch statement that figures out the different modes set in the DCPump classes. Where are those modes defined? I can't find them. In the process of prowling more code I'm finding more dependencies in different places.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

The modes are defined in the Globals.h

The case statements match the "Vortech" modes that are listed in the Portal. For any new modes, you'd use the "Custom" mode that's defined in the portal and then handle the condition in your INO.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wave patterns

Post by AlanM »

Oh really? OK. I get it, I think.

Sounds like adding ElseMode to the DCPump class is a bit more complicated than just including it in that switch/case statement because it wouldn't work to just make a #define ElseMode 7 line in there. I'd leave ElseMode out of my copy of ReefAngel.cpp and DCPump.Mode until figuring it out.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

Yeah, find the modes that are defined in Globals.h because the first available may not be until after 11 or 12... I think there are some that apply to the Radions. Not sure that's really a conflict. I dont' think there's anythign that would prevent it from being added into the code, except that if we wanted to advertise the support for it, it would need to be added in the portal. That's really a chicken and the egg discussion though... but if you build it they will come.. so they say ;)
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Wave patterns

Post by AlanM »

OK. Can look in to adding it there some more. My pull requests are in and seem to be fairly simple and compile for me, at least. 8)
User avatar
Rodasphoto
Posts: 187
Joined: Wed Apr 10, 2013 2:48 pm
Location: Athens, Ga
Contact:

Re: Wave patterns

Post by Rodasphoto »

subscribing for later use
Image
Ademster
Posts: 144
Joined: Tue Aug 14, 2012 1:11 pm

Re: Wave patterns

Post by Ademster »

how do I code all of the different pump options to cycle randomly. but also during feed mode to drop to 15 % .

running a wp-25 will be connected to the relay box dimming port.
Adam
58 Gal
Image
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Wave patterns

Post by Sacohen »

Ademster wrote:how do I code all of the different pump options to cycle randomly. but also during feed mode to drop to 15 % .

running a wp-25 will be connected to the relay box dimming port.
Take a look at the code in my signature.
lnevo helped me with exactly what I think you want to do.
The only difference is I'm using 2 pumps on Anti-Sync rather than 1 pump.
I have my drop to 0% during feed and 30% at night.
I think 15% is to low for the pumps. The Jebao have a minimum speed and when they go below that they will not ramp back up unless you pull the power to them and plug them back in.

I've found the WP-40 to be 25% and the WP-25 to be 30%.
Ademster
Posts: 144
Joined: Tue Aug 14, 2012 1:11 pm

Re: Wave patterns

Post by Ademster »

Thanks
Adam
58 Gal
Image
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Older thread I know but had a quick question or two after reading it. I'm considering picking up two Jebao wave makers but not sure if the model is correct or will work with the Jebao/Speedwave cable offered here.

It seems there is the standard WP series and now a RW series. Which version does the reef angel controller support? I just wanted to be sure so I order the correct one. I have two open ports I believe on my expansion or at least one there and then the original on the relay box that isn't used.

One cable per power head I'm assuming? I have a 40 breeder that has 4 power heads in there now and I'd like to clean things up a bit so wanted to run a pair and see how this wave pattern code works out. After reading it, it looks pretty neat.

Thanks for any help and or assistance. I'm guessing the WP 40's may be ok or just buy the larger one, WP 60, and re-use when I finally get a large tank. I am hoping the cable works with the RW series since it seems they do not clog as bad and have a few more settings.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Wave patterns

Post by Sacohen »

I have not seen the RW series personally, but I believe it is the same connection as the WP pumps.

Yes 1 cable per power head without some modifications.

2 60's in a 40 gallon is way to much power.
Go with 2 40's.
I actually had a 40 and 25 running in my 55 gallon and even then they were at 50% speed.
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Sacohen wrote:I have not seen the RW series personally, but I believe it is the same connection as the WP pumps.

Yes 1 cable per power head without some modifications.

2 60's in a 40 gallon is way to much power.
Go with 2 40's.
I actually had a 40 and 25 running in my 55 gallon and even then they were at 50% speed.
Thanks for the information. Yeah, I figured they would be too high and would need to be turned down. I was thinking, incorrectly it sounds like, that I could just power them down then reuse in a larger tank later. From what you are saying in regards to their power two 40's it is. Plus I will save a few bucks to spend on the cables.

Thank you again.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Wave patterns

Post by Sacohen »

Personally it think the 60's even powered down will be to strong for a 40 gallon.

The Jebao WP pumps had an issue that they would lock up if they went below a certain percentage.
With the WP-40's it seemed to be 30% and with the WP 25's it seemed to be 25% (or I have that reversed).

Maybe I misunderstood you or you misunderstood me. but you need 1 Jebao cable for each of the pumps.
It may be able to be done with 1 cable, but you would have to modify the cable quite a bit and it wouldn't be worth it.
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Sacohen wrote:Personally it think the 60's even powered down will be to strong for a 40 gallon.

The Jebao WP pumps had an issue that they would lock up if they went below a certain percentage.
With the WP-40's it seemed to be 30% and with the WP 25's it seemed to be 25% (or I have that reversed).

Maybe I misunderstood you or you misunderstood me. but you need 1 Jebao cable for each of the pumps.
It may be able to be done with 1 cable, but you would have to modify the cable quite a bit and it wouldn't be worth it.
Nope, you explained it perfectly and I'll be ordering two cables ;) You also helped me with regards to the power. So al is well and thank you again.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Wave patterns

Post by Sacohen »

No problem.
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Picked up two RW-4's for the 40 gallon breeder which is made up mostly of soft corals and 3 rose bubble tip anemones. My order for two cables came in so I just finished connecting everything and adding some basic code from a few pages back that cycled through reef crest and nutrient export modes. Uploaded the code and saw a blast of water movement then nothing.

Probably have my code in the wrong place I'm guessing because they shot on for a second then nothing. I'll need to clean this up and label the ports on the relay box since it is getting messy. Side note - I just added the wireless adapter and it works great. Question - do I have to disconnect the wireless adapter every time I want to upload new code?


Code:
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>

////// Place global variable code below here

////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.AddWifi();
ReefAngel.AddStandardMenu(); // Add Standard Menu

ReefAngel.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );


// Ports that are always on
ReefAngel.Relay.On( Port1 );

////// Place additional initialization code below here


////// Place additional initialization code above here
}

void loop()
{

ReefAngel.StandardLights( Port2,9,0,21,0 );
ReefAngel.StandardLights( Port4,9,0,21,0 ); // LED fans

ReefAngel.WavemakerRandom(Port5,60,300);

// ReefAngel.WavemakerRandom(Port5,120,600);
// ReefAngel.WavemakerRandom(Port6,120,600);

////// Place your custom code below here

// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
// ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
// ReefAngel.Relay.Set(Port8,!ReefAngel.Relay.Status(Port7));

// This will turn off both relays at a set time

if (hour()>=20 || hour()<10)
{
ReefAngel.Relay.Off(Port5); // large power head
ReefAngel.Relay.Off(Port6); // large power head
ReefAngel.Relay.Off(Port4); // LED fans
ReefAngel.Relay.On(Port7); // Small power head for night
ReefAngel.Relay.On(Port8); // Small power head for night
}
else
{

// Turn Port5 on/off random cycles that lasts from 25 to 60 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
ReefAngel.Relay.Off(Port7);
ReefAngel.Relay.Off(Port8);
}

// Channel 0 (1000mA max) - 5 Neutral White
// Channel 1 (1000mA max) - 6 Royal Blue + 5 Blue
// Channel 2 (700mA max) - 12 Lime
// Channel 3 (700mA max) - 5 Violet UV + 4 Deep Red (660nm)

ReefAngel.PWM.SetChannel( 0, PWMParabola(10,0,20,0,0,65,0) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(10,0,20,0,0,75,0) );
ReefAngel.PWM.SetChannel( 2, PWMParabola(10,0,20,0,0,65,0) );
ReefAngel.PWM.SetChannel( 3, PWMParabola(10,0,20,0,0,65,0) );

// Testing wave pumps
if (hour()>=16 && hour()<18)
{
ReefAngel.PWM.SetDaylight( NutrientTransportMode(77,90,3000,true) ); // Nutrient Transport on sync mode
ReefAngel.PWM.SetActinic( NutrientTransportMode(77,90,3000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=18 && hour()<16)
{
ReefAngel.PWM.SetDaylight( ReefCrestMode(50,20,true) ); // ReefCrest at 50% + - 20 on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(50,20,false) ); // ReefCrest at 50% + - 20 on anti-sync mode
}
////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "saf1" );
ReefAngel.DDNS( "saf1-dns.myreefangel.com" ); // Your DDNS is saf1-dns.myreefangel.com
ReefAngel.ShowInterface();
}
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Wave patterns

Post by Sacohen »

I'm not sure about the code, but a quick look it seems right, except it looks like you have the wave mode on ports 5 & 6 and are also using the DC Pump code.

If you don't have the Bluetooth module you will need to unplug the WiFi module every time you want to update your code.
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Yeah, that is odd. Not really sure at this point since I have cruddy notes and they don't look that great in the sketch either :( I just re-ran the wizard and it produced something that has at least one side working but not sure if this is right either so I'll need to continue to try. Also those little things can put out some water movement. I accidently had 90 percent I guess and everything was moving around way too much. Caught it and reset to 50 and everything seems pretty happy.

Originally on my power / relay box it was like this. Daylight and Actinic channels not used.

Plug 1 - skimmer (always on, off for feeding)
Plug 2 - Power supply for LED's - set time on/off
Plug 3 - NA
Plug 4 - LED heat sink fans - come on once LED's start up
Plug 5 - large power head powers on at 10 am until 8 pm
Plug 6 - large power head powers on at 10 am until 8 pm
Plug 7 - small power heads only coming on at 10 PM
Plug 8 - small power heads only coming on at 10 PM

The goal is to remove the koralia power heads and just use the RW-4's if I can get them to work together or educated is how I think they work :) I am reading it as reef crest daylight is set to sync with actinic set to antisync. So at some time - not sure when, one side shuts down and the other kicks in. Sort of simulating high/low tide. I just don't see that time window or cut off.

New code:
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
ReefAngel.AddPHExpansion(); // pH Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );

// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;

// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port4 );
ReefAngel.Relay.On( Port5 );
ReefAngel.Relay.On( Port6 );

////// Place additional initialization code below here


////// Place additional initialization code above here
}

void loop()
{
ReefAngel.StandardLights( Port2,9,0,21,0 ); // power to LED power supply
ReefAngel.StandardLights( Port4,9,0,21,0 ); // LED fans
// ReefAngel.WavemakerRandom( Port5,5,90 ); // Not sure what these are for now
// ReefAngel.WavemakerRandom( Port6,5,90 ); // Not sure what these are for now
// ReefAngel.StandardLights( Port7,9,0,21,0 );
// ReefAngel.StandardLights( Port8,9,0,21,0 );

// Channel 0 (1000mA max) - 5 Neutral White
// Channel 1 (1000mA max) - 6 Royal Blue + 5 Blue
// Channel 2 (700mA max) - 12 Lime
// Channel 3 (700mA max) - 5 Violet UV + 4 Deep Red (660nm)
ReefAngel.PWM.SetChannel( 0, PWMParabola(10,0,20,0,0,65,0) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(10,0,20,0,0,75,0) );
ReefAngel.PWM.SetChannel( 2, PWMParabola(10,0,20,0,0,65,0) );
ReefAngel.PWM.SetChannel( 3, PWMParabola(10,0,20,0,0,65,0) );

ReefAngel.DCPump.UseMemory = false;
ReefAngel.DCPump.SetMode( ReefCrest,50,10 );
ReefAngel.DCPump.DaylightChannel = Sync;
ReefAngel.DCPump.ActinicChannel = AntiSync;
// ReefAngel.DCPump.ExpansionChannel[0] = None;
// ReefAngel.DCPump.ExpansionChannel[1] = None;
// ReefAngel.DCPump.ExpansionChannel[2] = None;
// ReefAngel.DCPump.ExpansionChannel[3] = None;
// ReefAngel.DCPump.ExpansionChannel[4] = None;
// ReefAngel.DCPump.ExpansionChannel[5] = None;
////// Place your custom code below here


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "saf1" );
ReefAngel.DDNS( "saf1-dns.myreefangel.com" ); // Your DDNS is saf1-saf1-dns.myreefangel.com.myreefangel.com
ReefAngel.ShowInterface();
}
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Wave patterns

Post by cosmith71 »

That's not how ReefCrest works. ReefCrest slowly meanders between the midline (50 in your case) by +/- the offset (10 here). When the sync goes up, the antisync goes down. So they both should be on constantly, going between 40 and 60.

--Colin
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

cosmith71 wrote:That's not how ReefCrest works. ReefCrest slowly meanders between the midline (50 in your case) by +/- the offset (10 here). When the sync goes up, the antisync goes down. So they both should be on constantly, going between 40 and 60.

--Colin
Ok, that makes sense and also what I see although I thought I saw higher than 60 on one side. I'll add a if statement to get them to swap who is anti then.

Thanks, appreciate you taking time to explain it.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

You can use tide.IsIncoming() it might be isIncoming as your condition for swapping the channels
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Ok, thanks. I'll see if I can find an example of that. Right now I have the standard reef crest to go to 25 when the lights go off (9 PM). Then standard power when them come on again at 9 AM. I don't know what mode actually does what so I'm just using reef crest for now but would like to get the sides to alternate.

Does it make more sense to change flow patterns or just use one?

if (hour()>=21 || hour()<9)
{
// Sleep mode - slow things down
ReefAngel.DCPump.SetMode( ReefCrest,25,10 );
}
else
{
// Normal power
ReefAngel.DCPump.SetMode( ReefCrest,50,10 );
}
saf1
Posts: 111
Joined: Thu Jun 28, 2012 1:46 pm

Re: Wave patterns

Post by saf1 »

Ok, found the compile error. Case sensitive :) Was using uppercase T instead of lowercase t when calling tide. Not sure if this is the right way to set it up but the tide function has the if statement to set PWM sync or anti sync. Then I let my main run window use full power or reduce after lights out.

Thanks.
-scott

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>
#include <Tide.h>  // testing for tide control

////// Place global variable code below here
Tide tide;  // testing for tide control

////// Place global variable code above here


void setup()
{
 // This must be the first line
 ReefAngel.Init(); //Initialize controller
 ReefAngel.Use2014Screen(); // Let's use 2014 Screen 
 ReefAngel.AddPHExpansion(); // pH Expansion Module
 // Ports toggled in Feeding Mode
 ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
 // Ports toggled in Water Change Mode
 ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
 // Ports toggled when Lights On / Off menu entry selected
 ReefAngel.LightsOnPorts = 0;
 // Ports turned off when Overheat temperature exceeded
 ReefAngel.OverheatShutoffPorts = Port2Bit;
 // Use T1 probe as temperature and overheat functions
 ReefAngel.TempProbe = T1_PROBE;
 ReefAngel.OverheatProbe = T1_PROBE;
 // Set the Overheat temperature setting
 InternalMemory.OverheatTemp_write( 869 );

 // Feeeding and Water Change mode speed
 ReefAngel.DCPump.FeedingSpeed=0;
 ReefAngel.DCPump.WaterChangeSpeed=0;

 // Ports that are always on
 ReefAngel.Relay.On( Port1 );  // skimmer
 // ReefAngel.Relay.On( Port4 );  // LED Fans
 ReefAngel.Relay.On( Port5 );  // RW 4 left side facing tank
 ReefAngel.Relay.On( Port6 );  // RW 4 right side facing tank

 ////// Place additional initialization code below here


 ////// Place additional initialization code above here
}

void loop()
{
 ReefAngel.StandardLights( Port2,9,0,21,0 ); // power to LED power supply
 ReefAngel.StandardLights( Port4,9,0,21,0 ); // LED fans
// ReefAngel.WavemakerRandom( Port5,5,90 ); // Not sure what these are for now
// ReefAngel.WavemakerRandom( Port6,5,90 ); // Not sure what these are for now
// ReefAngel.StandardLights( Port7,9,0,21,0 );
// ReefAngel.StandardLights( Port8,9,0,21,0 );

// Channel 0 (1000mA max) - 5 Neutral White
// Channel 1 (1000mA max) - 6 Royal Blue + 5 Blue
// Channel 2 (700mA max) - 12 Lime
// Channel 3 (700mA max) - 5 Violet UV + 4 Deep Red (660nm)
 ReefAngel.PWM.SetChannel( 0, PWMParabola(9,0,21,0,0,65,0) );
 ReefAngel.PWM.SetChannel( 1, PWMParabola(9,0,21,0,0,75,0) );
 ReefAngel.PWM.SetChannel( 2, PWMParabola(9,0,21,0,0,65,0) );
 ReefAngel.PWM.SetChannel( 3, PWMParabola(9,0,21,0,0,65,0) );

 ReefAngel.DCPump.UseMemory = false;

// ReefAngel.DCPump.SetMode( ReefCrest,55,10 ); 
// ReefAngel.DCPump.DaylightChannel = Sync;
// ReefAngel.DCPump.ActinicChannel = AntiSync;

// Testing tidal function
if (tide.isIncoming()) {
   ReefAngel.DCPump.DaylightChannel = Sync;
   ReefAngel.DCPump.ActinicChannel = AntiSync;
}
else {
 ReefAngel.DCPump.DaylightChannel = AntiSync;
 ReefAngel.DCPump.ActinicChannel = Sync;
}

// ReefAngel.DCPump.ExpansionChannel[0] = None;
// ReefAngel.DCPump.ExpansionChannel[1] = None;
// ReefAngel.DCPump.ExpansionChannel[2] = None;
// ReefAngel.DCPump.ExpansionChannel[3] = None;
// ReefAngel.DCPump.ExpansionChannel[4] = None;
// ReefAngel.DCPump.ExpansionChannel[5] = None;
 
 ////// Place your custom code below here

if (hour()>=21 || hour()<9)
{
 // Sleep mode - slow things down 
 ReefAngel.DCPump.SetMode( ReefCrest,25,10 );
}
else
{
// Normal power
 ReefAngel.DCPump.SetMode( ReefCrest,50,10 );
 }

 ////// Place your custom code above here

 // This should always be the last line
 ReefAngel.Portal( "saf1" );
 ReefAngel.DDNS( "saf1-dns.myreefangel.com" ); // Your DDNS is saf1-saf1-dns.myreefangel.com.myreefangel.com
 ReefAngel.ShowInterface();
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Wave patterns

Post by lnevo »

Thats perfect! Now if you want to use the tide mode more you can set the parameters for the tide speed to fluctuate through the day and the variation would be based on the MoonPhase() so where you are calling SetMode and giving the ReefCrest speed you could get the speed from the tide class. Also the tide class kind of has a built in night mode at least how I have it set
Post Reply