HW cut off for Skimmer
Posted: Tue Jan 14, 2014 10:14 am
I would like to add a high water cutoff to my skimmate collection tank to prevent overflows. Can someone please verify the following code is correct. I am not a wiz at coding I tried to copy a LW cutoff code given I currently have. but it doesn't seem to be working. My skimmer is on Port 1. I am not sure if its not working because port 1 is on a low water cut off float and thinking maybe I am confusing it?
here's what I did a added a high water cutoff on menu, added menu 7 label, but their is already another label '7' in the color section??, you will see the area I am referring to in all CAPS, also switched lowATO to HIGHATO...is that correct??-
Would someone be able to please review the following high water cut off for me and please lmk where I went wrong?
Thanks in advance.
#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 <ReefAngel.h>
////// Place global variable code below here
#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "ATO Clear";
prog_char menu3_label[] PROGMEM = "Overheat Clear";
prog_char menu4_label[] PROGMEM = "PH Calibration";
prog_char menu5_label[] PROGMEM = "Version";
prog_char menu6_label[] PROGMEM = "Clear Low Water";
prog_char menu7_label[] PROGMEM = "Clear Skimmate High Water";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label, };
void MenuEntry1()
{
ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();
}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry6()
{
ReefAngel.DisplayVersion();
}
void MenuEntry7()
{
ReefAngel.Relay.RelayMaskOff=255;NOT SURE WHAT TO DO HERE DOES THIS NOW BECOME MENUENTRY8- WHAT IS IT FOR???
}
////// 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 = Port1Bit | Port5Bit | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 850 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );//Protien Skimmer
ReefAngel.Relay.On( Port7 );//Chiller
ReefAngel.Relay.On( Port8 );//Main pump
////// Place additional initialization code below here
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port2,9,0,21,30 );
ReefAngel.StandardLights( Port3,11,0,20,30 );
ReefAngel.StandardLights( Port4,9,0,21,30 );
ReefAngel.Wavemaker( Port5,960 );
ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.PWM.SetDaylight( PWMSlope(11,0,20,25,5,70,120,5) );
ReefAngel.PWM.SetActinic( PWMSlope(9,0,21,30,15,88,60,20) );
////// Place your custom code below here
static unsigned long lastATOCheck=millis();
ReefAngel.ReverseATOLow();
if (ReefAngel.LowATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.LowATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port8Bit | Port7Bit | Port1Bit);
if ( (hour()>=8 && hour()<20))//wavemakers on at 8am and off at 8pm
{
static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
if (cycle<0)
{
nexttoggle+=random(960,1020);//tunzes on for 15-16 mins
state=!state;
}
if (cycle<10)//10 sec overlap
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
static unsigned long lastATOCheck=millis();
ReefAngel.ReverseATOHigh();
if (ReefAngel.HighATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.HighATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port1Bit);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Seagals" );
ReefAngel.ShowInterface();
}
here's what I did a added a high water cutoff on menu, added menu 7 label, but their is already another label '7' in the color section??, you will see the area I am referring to in all CAPS, also switched lowATO to HIGHATO...is that correct??-
Would someone be able to please review the following high water cut off for me and please lmk where I went wrong?
Thanks in advance.
#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 <ReefAngel.h>
////// Place global variable code below here
#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Feeding";
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "ATO Clear";
prog_char menu3_label[] PROGMEM = "Overheat Clear";
prog_char menu4_label[] PROGMEM = "PH Calibration";
prog_char menu5_label[] PROGMEM = "Version";
prog_char menu6_label[] PROGMEM = "Clear Low Water";
prog_char menu7_label[] PROGMEM = "Clear Skimmate High Water";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label, };
void MenuEntry1()
{
ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();
}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.OverheatClear();
ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5()
{
ReefAngel.SetupCalibratePH();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry6()
{
ReefAngel.DisplayVersion();
}
void MenuEntry7()
{
ReefAngel.Relay.RelayMaskOff=255;NOT SURE WHAT TO DO HERE DOES THIS NOW BECOME MENUENTRY8- WHAT IS IT FOR???
}
////// 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 = Port1Bit | Port5Bit | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 850 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );//Protien Skimmer
ReefAngel.Relay.On( Port7 );//Chiller
ReefAngel.Relay.On( Port8 );//Main pump
////// Place additional initialization code below here
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port2,9,0,21,30 );
ReefAngel.StandardLights( Port3,11,0,20,30 );
ReefAngel.StandardLights( Port4,9,0,21,30 );
ReefAngel.Wavemaker( Port5,960 );
ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.PWM.SetDaylight( PWMSlope(11,0,20,25,5,70,120,5) );
ReefAngel.PWM.SetActinic( PWMSlope(9,0,21,30,15,88,60,20) );
////// Place your custom code below here
static unsigned long lastATOCheck=millis();
ReefAngel.ReverseATOLow();
if (ReefAngel.LowATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.LowATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port8Bit | Port7Bit | Port1Bit);
if ( (hour()>=8 && hour()<20))//wavemakers on at 8am and off at 8pm
{
static unsigned long nexttoggle=now();
static boolean state=false;
int cycle=nexttoggle-now();
ReefAngel.Relay.Set(Port5,state);
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
if (cycle<0)
{
nexttoggle+=random(960,1020);//tunzes on for 15-16 mins
state=!state;
}
if (cycle<10)//10 sec overlap
{
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
}
else
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
static unsigned long lastATOCheck=millis();
ReefAngel.ReverseATOHigh();
if (ReefAngel.HighATO.IsActive()) lastATOCheck=millis();
if (ReefAngel.HighATO.IsActive() && (millis()-lastATOCheck>2000)) ReefAngel.Relay.RelayMaskOff&=~(Port1Bit);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Seagals" );
ReefAngel.ShowInterface();
}