Re: Avast ATO and RA+
Posted: Fri Jun 13, 2014 8:47 am
Just to confirm, your ATO is disabled from 10pm to noon, right?
What time did you perform your test?
What time did you perform your test?
Community discussion about Reef Angel Controllers and reefing related subjects
http://forum.reefangel.com/
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 <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 = Port3Bit | Port5Bit | Port6Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 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( 810 );
// Ports that are always on
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Port8 );
ReefAngel.Relay.On( Port5 );
ReefAngel.Relay.On( Port6 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port1,13,30,22,30 ); //set for actinic
ReefAngel.SingleATO( false,Port2,900,0 ); //15 min time out
ReefAngel.StandardLights( Port4,14,0,22,0 ); //set for white light
//removed wavemaker functions because I don't want them turning off
ReefAngel.StandardHeater( Port7,775,780 );
ReefAngel.PWM.SetDaylight( PWMSlope(13,30,22,0,15,100,30,15) );
//ReefAngel.PWM.SetActinic( PWMParabola(13,0,22,30,15,100,15) );
////// Place your custom code below here
// prevent auto top off from 2200 to 1200
//if (hour()>12 && hour()<22)
//ReefAngel.SingleATO( false,Port2,600,0 );
//else
//ReefAngel.Relay.Off( Port2 );
if (hour()>12 && hour()<22)
ReefAngel.SingleATOLow( Port2 );
else
ReefAngel.Relay.Off( Port2 );
// Skimmer delay after feed or wc, 30 minutes
ReefAngel.Relay.DelayedOn( Port3,30 );
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Squishie89" );
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();
// pH Expansion
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,75, "PHE:" );
ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,75, ReefAngel.Params.PHExp );
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()
{
}
Code: Select all
if (hour()>12 && hour()<22)
That is supposed to be there. My tank is near my birds and they don't get woken up till noon/1pm and I don't want the top off pump bothering them while they are sleeping.cosmith71 wrote:Code looks ok, except for this line:
Technically, it will only run from 1 PM to 9 PM.Code: Select all
if (hour()>12 && hour()<22)
Run the controller test again. If you can't get it to change state, then there's an issue with the topoff unit. Since you've replaced the switch, I'd suspect the cable. Check the pins on the cable and make sure they're seated properly. If you have a voltmeter you might check continuity in the wires.
--Colin
Code: Select all
ReefAngel.SingleATOLow( Port1)
This line makes it use memory:Squishie89 wrote:I was able to get into the internal memory settings through the portal, currently trying to get it to save.
I don't understand what in my code makes it use the internal memory, I would prefer to keep everything in the code and not use the portal.
Code: Select all
ReefAngel.SingleATOLow( Port2 );
Code: Select all
ReefAngel.SingleATO( false,Port2,900,0 );