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>
////// Place global variable code below here
void SeasonalTemps ()
{
static int heatArray[][2] = { {778,784},// default in case of error in month=0 (May)
{762,768},//January (winter)
{766,772},//February (winter)
{770,776},//March (early spring)
{774,780},//April (spring)
{778,784},//May (spring)
{782,788},//June (early summer)
{786,792},//July (summer)
{782,788},//August (summer)
{778,784},//September (early fall)
{772,780},//October (fall)
{770,776},//November (fall)
{766,772} };//December (early winter)
ReefAngel.StandardHeater( Port1,heatArray[month()][0],heatArray[month()][1]);
}//end seasonalTemps
////// 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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port3Bit | Port5Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T2_PROBE;
//Feeding Timer
ReefAngel.Timer[FEEDING_TIMER].SetInterval(2100);
// Ports that are always on
ReefAngel.Relay.On( Port5 );
////// Place additional initialization code above here
}
void loop()
{
SeasonalTemps();
ReefAngel.ActinicLights( Port2 ); // Royal blue led strip
ReefAngel.DayLights( Port4 ); // T5's
ReefAngel.StandardFan( Port6 );
ReefAngel.PWM.DaylightPWMSlope();
ReefAngel.PWM.ActinicPWMSlope();
////// Place your custom code below here
// koralia 1150
// if (hour()>=23 || hour()<11) ReefAngel.Relay.Off( Port5 );
// else ReefAngel.WavemakerRandom( Port5, 120, 1800 );
//ATO
//if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 830))
// {
// ReefAngel.SingleATO(false,Port5,180,0); // Sump switch. Kalk schedule 8pm - 8am if pH < 8.3 If ATO/Kalk runs for 180 seconds, shut off and send alert.
// }
// else
//{
// ReefAngel.SingleATO(false,Port8,180,0); // Sump switch. If ATO/RoDi runs for 180 seconds, shut off and send alert.
// }
//skimmer off when collection container is full
if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port3);
else ReefAngel.StandardLights( Port3, 17,0,9,0); //skimmer off 9am-5pm
//light mover
//if (hour()>=9 && hour()<=21) ReefAngel.DosingPumpRepeat( Port6,0,90,2 ); // from 9am - 9pm, moves 2 seconds every 90 minutes with 0 minutes offset
//else ReefAngel.Relay.Off( Port6);
//kalk dosing
if ((hour()>13 && hour()<20) || (ReefAngel.Params.PH > 845))
{
ReefAngel.Relay.Off( Port7); // Kalk off 1pm - 8pm & if pH is > 8.45
}
else
{
ReefAngel.PHControl( Port7 );
}
//carbon dosing
if (hour()>=6 && hour()<23) ReefAngel.DosingPumpRepeat1( Port8 );
else ReefAngel.Relay.Off( Port8);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "reefology" );
ReefAngel.ShowInterface();
}
Original Post
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>
////// 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
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | 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( Port8 );
////// Place additional initialization code below here
ReefAngel.DDNS( "" );
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.DosingPumpRepeat1( Port1 );
ReefAngel.MoonLights( Port2 );
ReefAngel.ActinicLights( Port3 );
ReefAngel.DayLights( Port4 );
ReefAngel.WavemakerRandom( Port5,119,1200 );
ReefAngel.WavemakerRandom( Port6,99,1000 );
ReefAngel.StandardHeater( Port7 );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "" );
ReefAngel.DDNS( "" ); // Your DDNS is
ReefAngel.ShowInterface();
}