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 <ReefAngel.h>
////// Place global variable code below here
static bool feedStart; // Flag to see when feed mode has started
static unsigned long feedTimer; // timer to track when to trigger the feeder
//static int powerUpdelay = 10000;
////// 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 | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 830 );
// Ports that are start off
ReefAngel.Relay.Off( Port1 );
// Ports that are always on
ReefAngel.Relay.On( Port8 );
// Set Return Pump to 90%
ReefAngel.PWM.SetDaylight(90);
//delay(powerUpdelay);
ReefAngel.Relay.On( Port2 );
//delay(powerUpdelay);
ReefAngel.Relay.On( Port3 );
//delay(powerUpdelay);
ReefAngel.Relay.On( Port4 );
//delay(powerUpdelay);
ReefAngel.Relay.On( Port5 );
//delay(powerUpdelay);
ReefAngel.Relay.On( Port6 );
//delay(powerUpdelay);
//ReefAngel.Relay.DelayedOn( Port5,10 );
//ReefAngel.Relay.DelayedOn( Port6,20 );
ReefAngel.Relay.On( Port7 );
////// Place additional initialization code below here
ReefAngel.CustomLabels[0]="ATO";
ReefAngel.CustomLabels[1]="Skimmer";
ReefAngel.CustomLabels[2]="Fuge";
ReefAngel.CustomLabels[3]="GFO";
ReefAngel.CustomLabels[4]="Jabeo";
ReefAngel.CustomLabels[5]="MP10";
ReefAngel.CustomLabels[6]="Heater";
ReefAngel.CustomLabels[7]="Return";
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.SingleATO( true,Port1,60,0 );
ReefAngel.StandardHeater( Port7,708,810 );
////// Place your custom code below here
if (ReefAngel.DisplayedMenu!=FEEDING_MODE) feedStart=false; // Reset the flag...
if (ReefAngel.DisplayedMenu==FEEDING_MODE && feedStart==false) {
feedStart=true; // So we don't start the timer more than once per feeding mode.
feedTimer=now(); // We're going to use this time to see if 2 minutes is up before we trigger the feeder.
}
if ( feedStart==false) // 2 min later activate auto feeder
ReefAngel.PWM.SetDaylight(90);
else
ReefAngel.PWM.SetDaylight(50);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "g6gang" );
ReefAngel.ShowInterface();
}
So today I went to go into feed mode (using local web page) and nothing happened. No pumps shut off. So I am trying to figure out how things got out of sync and how to correct/ensure this does not happen again. I am going away for week and wifey will be in control of 'feeding' - concerned she will not turn everything back on and just want her to click the feed button.
On the Android app, the Water change mode flag current says 'off' as well as 'feeing mode'
I have not tried to reboot RA yet.