Trouble with ATO Custom Variable
Posted: Fri Mar 15, 2013 5:04 pm
I have my ATO in single mode and it is working fine but I copied code from the forum to set Custom Var 0 for the ATO Exceed flag. This was working fine for a while but now Custom Var 0 shows as 42 and I can't get it to reset at all. I ran the ATO to timeout and reset the unit but no luck. The ATO is functioning properly but the Custom Var is not.
#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 <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 = Port5Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );
// Ports that are always on
ReefAngel.Relay.On( Port5 );
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port1,14,0,22,0 );
ReefAngel.StandardHeater( Port2,770,780 );
ReefAngel.SingleATO( true,Port3,90,0 );
ReefAngel.StandardHeater( Port4,770,780 );
ReefAngel.StandardLights( Port6,22,0,12,0 );
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,0,15,100,60,15) );
////// Place your custom code below here
ReefAngel.CustomVar[0]=InternalMemory.read(ATO_Single_Exceed_Flag);
ReefAngel.CustomVar[1]=InternalMemory.read(Overheat_Exceed_Flag);
ReefAngel.CustomVar[7]=255;
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "marcwake" );
ReefAngel.ShowInterface();
}