Page 1 of 1
delayed start code
Posted: Thu Mar 07, 2013 4:07 pm
by emict326
how do i set to have port 6 be able to come on only after 30min if port 7 has run. port 7 is a power head stirring kalckwash and port 6 is the ato pump using that water
Re: delayed start code
Posted: Thu Mar 07, 2013 5:00 pm
by rimai
How often do you stir?
Re: delayed start code
Posted: Thu Mar 07, 2013 8:32 pm
by emict326
every 240min for 15sec. i have it set up as a dosing pump via the RA wizard
Re: delayed start code
Posted: Thu Mar 07, 2013 9:02 pm
by rimai
Try this:
Code: Select all
ReefAngel.DosingPumpRepeat(Port7,0,240,15);
ReefAngel.DosingPumpRepeat(Port6,30,240,15);
Re: delayed start code
Posted: Thu Mar 07, 2013 9:11 pm
by emict326
OK i know that you are very busy but could you pleas explain to me what the numbers in there potions mean. i would like to learn why vs just having it given to me so i do not have to bother you next time
Re: delayed start code
Posted: Thu Mar 07, 2013 9:17 pm
by rimai
No problem.
Here are the parameters for this function:
http://www.easte.net/RA/html/class_reef ... 1a7dee9cbe
The first parameter is the port.
The second parameter is the offset
The third parameter is the total cycle
The forth parameter is the runtime
So, The first line will turn port 7 for 15s every 240minutes with zero offset. So it will be on the dot of every 240minutes
The 2nd line is the same thing for port6, but with a 30minute offset. So it is actually lagging by 30minutes compared to the 1st line.
I hope it was clear.
Re: delayed start code
Posted: Thu Mar 07, 2013 9:38 pm
by emict326
OK so port 6 is my ato pump controlled by a single low float switch. what i am wanting is for the ATO not to be able to be activated for 30min after my calk stir goes off to give the slurry time to settle. I am not sure that the code above will achieve that, but from what you just taught me will the code below work? or will the single ATO never activate. and how does it know if you are talking about sec, or min? also i have the setings saved in memory not code if that matters
ReefAngel.DosingPumpRepeat(Port7,0,240,15);
ReefAngel.SingleATOLow(Port6,30,240,0);
Re: delayed start code
Posted: Thu Mar 07, 2013 10:22 pm
by rimai
Oh... now I understand what you are trying to do.
Those parameters will only work on the DosingPumpRepeat() function.
The SingleATOLow() has a different set of parameters. In fact, the only parameter is the port number.
It's meant to use internal memory settings.
http://www.easte.net/RA/html/class_reef ... dbe9f32eb8
For what you are trying to do, you need to do something like this:
Code: Select all
ReefAngel.DosingPumpRepeat(Port7,0,240,15);
if (now()%(240*60)<(30*60))
ReefAngel.Relay.Off(Port6);
else
ReefAngel.SingleATO(true,Port6,60,0);
This code is checking if it should run ATO function or turn off the relay port.
Give it a shot.
Re: delayed start code
Posted: Thu Mar 07, 2013 10:53 pm
by emict326
#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
ReefAngel.AddStandardMenu();
ReefAngel.AddDateTimeMenu();
ReefAngel.FeedingModePorts = Port1Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port5 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardHeater( Port2 );
ReefAngel.ActinicLights( Port3 );
ReefAngel.DayLights( Port4 );
ReefAngel.SingleATOLow( Port6);
ReefAngel.DosingPump( Port7,0,240,15);
////// Place your custom code below here
if (ReefAngel.LowATO.IsActive()) ReefAngel.Relay.Off(Port7);
ReefAngel.DosingPumpRepeat(Port7,0,240,15);
if (now()%(240*60)<(30*60)
)ReefAngel.Relay.Off(Port6);
else
ReefAngel.SingleATO(true,Port6,60,0);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "emict326" );
ReefAngel.ShowInterface();
}
here is my whole code
Now i Get a Compiling error
Re: delayed start code
Posted: Thu Mar 07, 2013 11:01 pm
by rimai
Sorry, I missed one parenthesis....
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
ReefAngel.AddStandardMenu();
ReefAngel.AddDateTimeMenu();
ReefAngel.FeedingModePorts = Port1Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port5 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardHeater( Port2 );
ReefAngel.ActinicLights( Port3 );
ReefAngel.DayLights( Port4 );
////// Place your custom code below here
ReefAngel.DosingPumpRepeat(Port7,0,240,15);
if (ReefAngel.LowATO.IsActive()) ReefAngel.Relay.Off(Port7);
if (now()%(240*60)<(30*60))
ReefAngel.Relay.Off(Port6);
else
ReefAngel.SingleATO(true,Port6,60,0);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "emict326" );
ReefAngel.ShowInterface();
}