Can you check these code..right?
Posted: Fri Aug 10, 2012 2:04 pm
I try to make my own schedule from copy and paste..
so, I am not sure these code are correct or not.
Did not tried yet, just make sure it's ok.
my schedule as regular light dimming as parabola on and off, 2 wave maker, 3 temp
specific codes are
port7 - turn on always but when it's off that will be on automatically after 4hrs
port5, 6 - auto feed mode; turn off 6:45am, 1:45pm, 6:45pm for 11min. and then on
port8 - LED light fan; turn on 95.5f and off 85.5f (using T3 temp)
#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
unsigned long LastPort7On=now();
////// 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 | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 860 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
////// Place additional initialization code below here
{
ReefAngel.Init();
ReefAngel.Timer[FEEDING_TIMER].SetInterval(660);
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
ReefAngel.PHMin=542;
ReefAngel.PHMax=838;
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardATO( Port1,60 );
ReefAngel.StandardLights( Port2,8,30,23,30 );
ReefAngel.StandardHeater( Port3,775,785 );
ReefAngel.StandardFan( Port4,785,805 );
ReefAngel.StandardLights( Port5,8,30,21,30 );
ReefAngel.Wavemaker( Port6,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,20,0,10,35,10) );
ReefAngel.PWM.SetActinic( PWMParabola(9,0,23,0,11,35,11) );
////// Place your custom code below here
if (ReefAngel.Relay.Status(Port7)) LastPort7On=now();
if (now()-LastPort7On > 14400)
{
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.RelayMaskOff|=Port7Bit;
}
{
if(hour()==6 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
if(hour()==13 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
if(hour()==18 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
}
if (ReefAngel.Params.Temp[T3_PROBE] > 950) ReefAngel.Relay.On(Port8);
if (ReefAngel.Params.Temp[T3_PROBE] < 850) ReefAngel.Relay.Off(Port8);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "kimacom" );
ReefAngel.ShowInterface();
}
are they all right? did i put too many { }things?
if i am wrong or missing some code, please correct me
thanks
so, I am not sure these code are correct or not.
Did not tried yet, just make sure it's ok.
my schedule as regular light dimming as parabola on and off, 2 wave maker, 3 temp
specific codes are
port7 - turn on always but when it's off that will be on automatically after 4hrs
port5, 6 - auto feed mode; turn off 6:45am, 1:45pm, 6:45pm for 11min. and then on
port8 - LED light fan; turn on 95.5f and off 85.5f (using T3 temp)
#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
unsigned long LastPort7On=now();
////// 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 | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 860 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
////// Place additional initialization code below here
{
ReefAngel.Init();
ReefAngel.Timer[FEEDING_TIMER].SetInterval(660);
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit;
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
}
ReefAngel.PHMin=542;
ReefAngel.PHMax=838;
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardATO( Port1,60 );
ReefAngel.StandardLights( Port2,8,30,23,30 );
ReefAngel.StandardHeater( Port3,775,785 );
ReefAngel.StandardFan( Port4,785,805 );
ReefAngel.StandardLights( Port5,8,30,21,30 );
ReefAngel.Wavemaker( Port6,300 );
ReefAngel.PWM.SetDaylight( PWMParabola(11,0,20,0,10,35,10) );
ReefAngel.PWM.SetActinic( PWMParabola(9,0,23,0,11,35,11) );
////// Place your custom code below here
if (ReefAngel.Relay.Status(Port7)) LastPort7On=now();
if (now()-LastPort7On > 14400)
{
ReefAngel.Relay.On(Port7);
ReefAngel.Relay.RelayMaskOff|=Port7Bit;
}
{
if(hour()==6 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
if(hour()==13 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
if(hour()==18 && minute()==45 && second()==0) ReefAngel.FeedingModeStart();
}
if (ReefAngel.Params.Temp[T3_PROBE] > 950) ReefAngel.Relay.On(Port8);
if (ReefAngel.Params.Temp[T3_PROBE] < 850) ReefAngel.Relay.Off(Port8);
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "kimacom" );
ReefAngel.ShowInterface();
}
are they all right? did i put too many { }things?
if i am wrong or missing some code, please correct me
thanks