I'm trying to setup a CO2 solenoid to turn on between 12:00 and 19:00.
I have an RA Plus.
I used the Wizard via the web plugin and created my basic code using internal memory.
I used the Timed Schedule option to setup the port.
It didn't turn on and off
I used the Android App to change the on/off times using StdLights On/Off in the memory tab and had no luck.
I have control over the relay via the the phone app and the Local web interface.
So I figured what the heck..... try code it and see if I can do it - spoiler alert...I have failed
Can you guys help me trouble shoot the Timed Schedule and grade my attempt at coding as well
I have defined my ports and labelled them like this so I can make sense of my code -
This sits under the #include right at the start.
Code: Select all
#define Return Port1
#define Osmolater Port2
#define Heater Port3
#define RW4 Port4
#define SumpPump Port5
#define Doser Port6
#define GasPump Port7 // I originally had this labelled CO2 but thought it might be the cause of the issue
#define Fans Port8
Code: Select all
////// Place additional initialization code below here
ReefAngel.CustomLabels[0]="Return";
ReefAngel.CustomLabels[1]="ATO";
ReefAngel.CustomLabels[2]="Heater";
ReefAngel.CustomLabels[3]="RW4";
ReefAngel.CustomLabels[4]="SumpPump";
ReefAngel.CustomLabels[5]="Doser";
ReefAngel.CustomLabels[6]="GasPump";
ReefAngel.CustomLabels[7]="Fans";
////// Place additional initialization code above here
Attempt1 ripped from your guys forum replies..
Code: Select all
////// Place global variable code below here
void GasPumpTimer() //Timer for CO2 Relay until I get the std light timer working
{
if (hour()>=12 && hour()<19)
{
ReefAngel.Relay.On (GasPump);
}
}
////// Place global variable code above here
Code: Select all
////// Place global variable code below here
void GasPumpTimer() //Timer for CO2 Relay until I get the std light timer working
{
if (hour()<12 || hour()>=19)
{
ReefAngel.Relay.Off (GasPump);
}
}
////// Place global variable code above here
Code: Select all
////// Place global variable code below here
void GasPumpTimer() //Timer for CO2 Relay until I get the std light timer working
{
if ((hour()<12) || (hour()>=19))
{
ReefAngel.Relay.Off (GasPump);
}
}
////// Place global variable code above here
If I flip the < and > logic it turns the relay off and that's it. it seems to ignore the "second half".
So I thought..... aha.....I need an "else".
Bring on...
Code: Select all
{
if ((hour()<12) || (hour()>=19))
{
ReefAngel.Relay.Off (GasPump);
}
else
{
ReefAngel.Relay.On(GasPump);
}
}
I also commented out
Code: Select all
ReefAngel.Relay.On( GasPump );
What am I missing?