what controller are you using and why?

spent a few more mins on it and roberto at RA helped me with some syntax questions.
anyways here is the last update seems to be working well so far.


static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

if ( (hour()>=9 && hour()<15))
{

if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=15 && hour()<21) )
{
if (cycle<0)
{
nexttoggle+=random(15,20);
state=!state;
}
if (cycle<8)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=21 && hour()<24) )
{
if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
if (cycle<0) nexttoggle+=90;
if (cycle<30)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.Off(Port6);
}
if (cycle > 30 && cycle < 60)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
if (cycle < 60)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.On(Port6);
}
}
 
k now im done messing with it =P

static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

if ( (hour()>=9 && hour()<15))
{
if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=15 && hour()<21) )
{
if (cycle<0)
{
nexttoggle+=random(15,20);
state=!state;
}
if (cycle<8)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=21 && hour()<24) )
{
if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
if (cycle<0)
{
nexttoggle+=random(60,90);
state=!state;
}
if (cycle<30)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
}
 
No, really it could be just 3-4 lines.
i just wanted mine to do be random waves, overlap waves sometimes, stronger waves during certain times of the day, stuff like that.
 
Not at all...it could be as simple as:
ReefAngel.WavemakerRandom( Port5,60,100 );
ReefAngel.WavemakerRandom( Port6,60,100 );


But it's all about how deep you want to see the rabit hole goes :) The red pill or the blue pill...ya know?
 
Last edited:
Drew,
Which probes do you have for yours?
I have the Salinity and the ORP probe , salinity is working good. I have not received my ORP probe configuration solution yet though so i havnt been able to get mine up and going yet.

I assume i can access the probe values in code right?
What i want to do now is setup the float valves but only pump fresh water into the tank if doing so will not let my salt drop below a certain level.

just a thought but i guess really i could control a constant water change through the whole system like this if i wanted to..
 
it's here! now to find some free time to install the new sump so i can get the ra up and going. i might use my ato.com switches for ato and the ra ones for alerts....unless anyone has seen how to build a casing for the ra ones to protect from snails
 
Awesome!!!! The fun begins

As far as probe code. The majority is in the libraries but I know I have/can modify my pH output readings. As far was water changes you can monitor with the salinity probe but probes have a way of going south without warning. You can make a code that allows for multiple functions on a single relay but if the probe goes south you would have an issue on your hands. I would do water changes with a combo of refrac reading and draw then water into the system then. I wouldn't rely on the probe.
 
Did you place your code in the loop?
this compiles for me. if you copy this, be sure to update your user name so you can check your portal online if you ordered a wireless expansion.


void loop()
{

ReefAngel.StandardATO( Port1,30 );


static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));

if ( (hour()>=9 && hour()<15))
{
if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=15 && hour()<21) )
{
if (cycle<0)
{
nexttoggle+=random(15,20);
state=!state;
}
if (cycle<8)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else if ( (hour()>=21 && hour()<24) )
{
if (cycle<0)
{
nexttoggle+=random(35,45);
state=!state;
}
if (cycle<5)
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
if (cycle<0)
{
nexttoggle+=random(60,90);
state=!state;
}
if (cycle<30)
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
}



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

// This should always be the last line
ReefAngel.Portal( "UPDATEYOURUSERNAMEHERE" );
ReefAngel.ShowInterface();
}
 
Not to my knowledge. I have a small not so powerful desktop that is hooked to the TTL-USB all the time. I then remote into it and code/upload. Packets of code cannot be transferred via wireless sadly. One day it'll be possible but until then the USB cable is the only way to upload
 
It's the one downside I've found. But hey just go out and get an old dell. It just needs to run a basic OS. Then remote in. You never have to run back and forth again. Any junker CPU will do because if it crashes you lose nothing on the RA. Just replace and go again
 
well it looks nice :) Work has been so busy the sump build is going really slow...hoping to get some reef stuff done on Thursday. The RA is still in the box :(
 
Back
Top