i want when the float active then skimmer is auto,on or delayedon to override
when the float is deactive it turns off but when active again it turns back to auto,on or delayedon to override
im doing this
Code: Select all
if(ReefAngel.HighATO.IsActive()!=1){ReefAngel.Relay.Override(SKIMMER,0);} else {ReefAngel.Relay.Override( SKIMMER,2 );}
and it is ignoring the relay off for waterchangemode,feedmode but the delayon is working
full code
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 <PAR.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code below here
// Define Custom Memory Locations
#define Mem_B_AtoHourInterval 101 //MB101
#define Mem_B_LightsOffPerc 102 //MB102
#define Mem_I_ReturnDelay 103 //MI103
void init_memory() {
// Initialize Custom Memory Locations
InternalMemory.write(Mem_B_AtoHourInterval,1); //MB101 "(Mem_B_AtoHourInterval,X)"X=hour
InternalMemory.write(Mem_B_LightsOffPerc,0); //MB102
InternalMemory.write(Mem_I_ReturnDelay,300); //MI103 "(Mem_I_ReturnDelay,X)"X=sec
}
// Define Relay Ports by Name
#define AUTOTOPOFF 1
#define SKIMMER 2
#define BLUELED 3
#define WHITELED 4
#define HEATER 5
#define POWERHEAD 6
#define FAN 7
#define RETURN 8
//dimmingchannel call out
// 0 blue led channel
// 1 white led channel
// 2
// 3
// 4 powerhead left
// 5 powerhead right
////// 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 = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port8Bit ;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port8Bit ;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit ;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port5Bit ;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
// Ports that are always on
// ReefAngel.Relay.On( SKIMMER );
ReefAngel.Relay.On( POWERHEAD );
ReefAngel.Relay.On( FAN );
ReefAngel.Relay.On( RETURN );
// Ports that are delayed on
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.Relay.DelayedOn( SKIMMER );
ReefAngel.SingleATO(true, AUTOTOPOFF , InternalMemory.ATOExtendedTimeout_read(), InternalMemory.read(Mem_B_AtoHourInterval));
ReefAngel.StandardHeater ( HEATER );
ReefAngel.PWM.Channel0PWMParabola();
ReefAngel.PWM.Channel1PWMParabola();
ReefAngel.DCPump.UseMemory = true;
//REMOVE ReefAngel.DCPump.DaylightChannel = None;
//REMOVE ReefAngel.DCPump.ActinicChannel = None;
//REMOVE ReefAngel.DCPump.ExpansionChannel[0] = None;
//REMOVE ReefAngel.DCPump.ExpansionChannel[1] = None;
//REMOVE ReefAngel.DCPump.ExpansionChannel[2] = None;
//REMOVE ReefAngel.DCPump.ExpansionChannel[3] = None;
ReefAngel.DCPump.ExpansionChannel[4] = Sync;
ReefAngel.DCPump.ExpansionChannel[5] = AntiSync;
if(ReefAngel.HighATO.IsActive()!=1){ReefAngel.Relay.Override(SKIMMER,0);} else {ReefAngel.Relay.Override( SKIMMER,2 );}
//if ( ReefAngel.HighATO.IsActive() == 1 ) {ReefAngel.Relay.Override( SKIMMER,2 );} else {ReefAngel.Relay.Off( SKIMMER );}
//REMOVE if ( ReefAngel.HighATO.IsActive() != 1 ) ReefAngel.Relay.Off( SKIMMER );
////// Place your custom code below here
//C blue led relay port 3/BLUELED +dimming channel 0
if (ReefAngel.PWM.GetChannelValue(0) > InternalMemory.read(Mem_B_LightsOffPerc)) {
// Value over MB102
ReefAngel.Relay.On(BLUELED);
} else {
// otherwise, value IS MB102 or less (which should never happen)
ReefAngel.Relay.Off(BLUELED);
}
//C blue led relay port 3/BLUELED +dimming channel 0
//C white led relay port 4/WHITELED +dimming channel 1
if (ReefAngel.PWM.GetChannelValue(1) > InternalMemory.read(Mem_B_LightsOffPerc)) {
// Value over MB102
ReefAngel.Relay.On(WHITELED);
} else {
// otherwise, value IS MB102 or less (which should never happen)
ReefAngel.Relay.Off(WHITELED);
}
//C white led relay port 4/WHITELED +dimming channel 1
//C First X minutes after feeding mode disable return
static time_t FMTimer=0;
if (ReefAngel.DisplayedMenu == FEEDING_MODE) FMTimer=now();
if (now()-FMTimer >= 0 && now()-FMTimer < InternalMemory.read(Mem_I_ReturnDelay))
{ReefAngel.Relay.Off(RETURN);}else{ReefAngel.Relay.On(RETURN);}
//C First X minutes after feeding mode disable return
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "troylong45" );
ReefAngel.ShowInterface();
}