// Autogenerated file by RAGen (v1.2.1.158), (02/21/2012 19:09)
// RA_022112_1909.ino
//
// This version designed for v0.9.0 or later
/* The following features are enabled for this File:
#define DisplayLEDPWM
#define wifi
#define WDT
#define SIMPLE_MENU
#define CUSTOM_MAIN
#define ENABLE_ATO_LOGGING
#define ENABLE_EXCEED_FLAGS
#define CUSTOM_VARIABLES
*/
#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 <ReefAngel.h>
int DP3_Timer = InternalMemory.DP1Timer_read() * 4;
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 10, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor(15, 10, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
byte x = 8;
byte y = 45;
char text[7];
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x, y, "DP1:");
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+25, y, InternalMemory.DP1Timer_read());
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+37, y, "DP2:");
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+62, y, InternalMemory.DP2Timer_read());
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+75, y, "DP3:");
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+101, y, DP3_Timer);
x = 6;
y += MENU_START_ROW+6;
y -= 3;
ReefAngel.LCD.Clear(COLOR_BLACK, x, y, 124, y);
y +=1;
ReefAngel.LCD.Clear(COLOR_BLUE, x+1, y, 123, y+10);
y +=11;
ReefAngel.LCD.Clear(COLOR_BLACK, x, y, 124, y);
ReefAngel.LCD.Clear(COLOR_BLACK, x, y-11, x, y+16);
ReefAngel.LCD.Clear(COLOR_BLACK, 124, y-11, 124, y+16);
ReefAngel.LCD.DrawText(COLOR_WHITE, COLOR_BLUE, x+40, y-9, "Alarms");
y += 6;
x += 2;
byte fcolor;
// This is for the LOW Ato switch
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+2, y,"ATO:");
if ( InternalMemory.read(ATO_Single_Exceed_Flag) == 1 )
{
// add in InternalMemory.write(700, 1) when ato is tripped
// add in InternalMemory.write(700, 0) when ato is cleared
fcolor = COLOR_RED;
ReefAngel.LCD.DrawText(fcolor, DefaultBGColor, x+30, y, "YES");
}
else
{
fcolor = COLOR_GREEN;
ReefAngel.LCD.DrawText(fcolor, DefaultBGColor, x+30, y, "NO ");
}
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, x+55, y,"OverH:");
if ( InternalMemory.read(Overheat_Exceed_Flag) == 1 )
{
// add in InternalMemory.write(701, 1) when overheat is tripped
// add in InternalMemory.write(701, 0) when overheat is cleared
fcolor = COLOR_RED;
strcpy(text, "YES");
}
else
{
fcolor = COLOR_GREEN;
strcpy(text, "NO ");
}
ReefAngel.LCD.DrawText(fcolor, DefaultBGColor, x+94, y, text);
ReefAngel.LCD.Clear(COLOR_BLACK, x-2, y+11, 124, y+11);
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 95, TempRelay);
}
void DrawCustomGraph()
{
// ReefAngel.LCD.DrawGraph(5, 5);
}
void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.SetTemperatureUnit(1); // set to Celsius Temperature
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
int DP3_Timer = InternalMemory.DP1Timer_read() * 4;
}
void loop()
{
// Specific functions
ReefAngel.StandardFan(Port1);
ReefAngel.MHLights(Port2);
// ReefAngel.DosingPump1(Port3);
//ReefAngel.DosingPumpRepeat(Port3, 0, 360, InternalMemory.DP1Timer_read());
ReefAngel.Relay.DelayedOn(Port4, 5);
// ReefAngel.DosingPump2(Port5);
//ReefAngel.DosingPumpRepeat(Port5, 10, 360, InternalMemory.DP2Timer_read());
ReefAngel.SingleATOHigh(Port6);
ReefAngel.StandardHeater(Port8);
ReefAngel.DosingPump(Port3, 1, 23, 20, InternalMemory.DP1Timer_read());
ReefAngel.DosingPump(Port3, 1, 05, 00, InternalMemory.DP1Timer_read());
ReefAngel.DosingPump(Port3, 1, 11, 00, InternalMemory.DP1Timer_read());
ReefAngel.DosingPump(Port3, 1, 17, 00, InternalMemory.DP1Timer_read());
ReefAngel.DosingPump(Port5, 2, 23, 30, InternalMemory.DP2Timer_read());
ReefAngel.DosingPump(Port5, 2, 05, 10, InternalMemory.DP2Timer_read());
ReefAngel.DosingPump(Port5, 2, 11, 10, InternalMemory.DP2Timer_read());
ReefAngel.DosingPump(Port5, 2, 17, 10, InternalMemory.DP2Timer_read());
// ReefAngel.DosingPump(Port7, 23, 20, DP3_Timer); // Setup Dosing Pump 3 Oligo
ReefAngel.ShowInterface();
if ( InternalMemory.read(ATO_Single_Exceed_Flag) == 1 )
{
ReefAngel.CustomVar[0]=1;
}
else
{
ReefAngel.CustomVar[0]=0;
}
if ( InternalMemory.read(Overheat_Exceed_Flag) == 1 )
{
ReefAngel.CustomVar[1]=1;
}
else
{
ReefAngel.CustomVar[1]=0;
}
}
with the new version the dosingpump repeat don't work.... or i' m not able....