Page 1 of 1

Refugium Light

Posted: Fri Sep 14, 2012 5:50 pm
by Thavngr98
So I used the wizard to setup up my relay box but when I load the code to Audrino I dont see any of it. Is that when written to memory that its not listed in the code? What im trying to do is lessen the timer on my Refugium light right now with the wizard it only lets you do On Opposite of Daylight and Blues. For me this is too long of a period for the refugium light to come stay on. Can you supply a custom code so that outlet 4 goes on at 3am and goes off at 9am?

Here is my current code

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 <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
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port7Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port6Bit | Port8Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


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

    ////// Place additional initialization code below here
    ReefAngel.AddDateTimeMenu();
    ReefAngel.Timer[FEEDING_TIMER].SetInterval(950);
    ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port5);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);

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

void loop()
{
    ReefAngel.StandardATO( Port1 );
    ReefAngel.DayLights( Port2 );
    ReefAngel.ActinicLights( Port3 );
    ReefAngel.MoonLights( Port4 );
    ReefAngel.StandardHeater( Port6 );
    ReefAngel.StandardFan( Port7 );
    ////// Place your custom code below here
    if(hour()==7 && minute()==55 && second()==0) ReefAngel.FeedingModeStart();
    if(hour()==18 && minute()==55 && second()==0) ReefAngel.FeedingModeStart();

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

    // This should always be the last line
    ReefAngel.Portal( "thavngr98" );
    ReefAngel.ShowInterface();
}

Re: Refugium Light

Posted: Fri Sep 14, 2012 5:58 pm
by rimai
Which port is it?

Re: Refugium Light

Posted: Fri Sep 14, 2012 6:02 pm
by Thavngr98
port 4

Re: Refugium Light

Posted: Fri Sep 14, 2012 6:23 pm
by rimai
Replace this:

Code: Select all

    ReefAngel.MoonLights( Port4 );
With this:

Code: Select all

    ReefAngel.StandardLights( Port4,9,0,20,0 );

Re: Refugium Light

Posted: Sat Sep 15, 2012 6:28 am
by Thavngr98
That didnt work. I just uploaded the new code and its 9:30 am here and the light on port 4 is on

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 <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
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port7Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port6Bit | Port8Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


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

    ////// Place additional initialization code below here
    ReefAngel.AddDateTimeMenu();
    ReefAngel.Timer[FEEDING_TIMER].SetInterval(950);
    ReefAngel.FeedingModePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port5);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);
    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardATO( Port1 );
    ReefAngel.DayLights( Port2 );
    ReefAngel.ActinicLights( Port3 );
    ReefAngel.StandardLights( Port4,9,0,20,0 );
    ReefAngel.StandardHeater( Port6 );
    ReefAngel.StandardFan( Port7 );
    ////// Place your custom code below here
    if(hour()==7 && minute()==55 && second()==0) ReefAngel.FeedingModeStart();
    if(hour()==18 && minute()==55 && second()==0) ReefAngel.FeedingModeStart();


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

    // This should always be the last line
    ReefAngel.Portal( "thavngr98" );
    ReefAngel.ShowInterface();
}


Re: Refugium Light

Posted: Sat Sep 15, 2012 8:29 am
by rimai
You need to change the time settings on the function.
I don't know what time you wanted, so I just put any number.
In fact, it turns on at 9:00am and off at 8:00pm

Re: Refugium Light

Posted: Sat Sep 15, 2012 9:44 am
by alexwbush
You need to change it to:

Code: Select all

ReefAngel.StandardLights( Port4,A,B,C,D );
Where...
A is the turn on hour (0-23)
B is the turn on minute (0-59)
C is the turn off hour (0-23)
D is the turn off minute (0-59)

All times are military times 0:00-23:59

So if you wanted to turn on 8:30pm-6:15am:

Code: Select all

ReefAngel.StandardLights( Port4,20,30,6,15 );

Re: Refugium Light

Posted: Sat Sep 15, 2012 9:58 am
by Thavngr98
LOL ok I just assumed it was correct since I posed the time in the original post. No problem Ill give it a shot