Putting protein skimmer on a schedule

Do you have a question on how to do something.
Ask in here.
Post Reply
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Putting protein skimmer on a schedule

Post by Seagals »

Hi - I would like to have my skimmer on Port 1 go on at 8am and turn on a 9pm and I need some guidance before I mess with my code.

right now the skimmer is always on code as follows:

// Ports that are always on
ReefAngel.Relay.On( Port1 );//Protein skimmer
ReefAngel.Relay.On( Port7 );//Chiller
ReefAngel.Relay.On( Port8 );//Main pump

Question - if I am now putting the skimmer on a schedule should I remove port 1 (skimmer) from this section??

Now the schedule part - if you would please confirm I added the code correctly before I mess up my existing code......

////// Place additional initialization code above here
}

void loop()
{
ReefAngel.ProteinSkimmer( Port1,8,0,21,00);
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();
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);
}


////// Place your custom code above here


Thanks in advance for your help.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Putting protein skimmer on a schedule

Post by rimai »

Yes, remove the Relay.On, but use StandardLights not ProteinSkimmer
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Putting protein skimmer on a schedule

Post by lnevo »

ReefAngel.Relay.StandardLights( Port1,8,0,21,0 );//Protein skimmer
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Re: Putting protein skimmer on a schedule

Post by Seagals »

Hey - Inevo - got the idea from the MR site - I wanted to give it a try see how the tank does with less Skimmer use....The following is the code but when I verified it I got the following error:

'class Relayclass' has no member named 'StandardLights'

Sorry guys thought I couold give it try on my own but I need your review of the following and offer a solution. Thanks

#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";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_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;
}


////// 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( 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.Relay.StandardLights( Port1,8,0,21,0 );//Protein skimmer
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();
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);
}


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "Seagals" );
ReefAngel.ShowInterface();
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Putting protein skimmer on a schedule

Post by lnevo »

Sorry my bad. Take out the relay part. Make it look like your other StandardLights calls
Seagals
Posts: 127
Joined: Wed Aug 01, 2012 7:06 am

Re: Putting protein skimmer on a schedule

Post by Seagals »

ok verified and uploaded - thanks
Post Reply