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 <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.h>
#include <PH.h>
#include <WaterLevel.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.WaterChangePorts= Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.Wavemaker(Port5,60);
ReefAngel.Wavemaker(Port6,120);
ReefAngel.StandardHeater(Port7,757,763);
// ReefAngel.StandardLights(Port8,17,0,13,0);
ReefAngel.WaterLevelATO(Port8,60,70,75); // 60 seconds timeout, turn on at 70% and turn off at 75%
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();
// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 95, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}