over flow siphon

Do you have a question on how to do something.
Ask in here.
Post Reply
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

over flow siphon

Post by Spotted »

I have a hang on back siphon that I have setup in my controller to run for an hour every day. I don't want it to run all day long and the syphon works rather well and just needs a bit done every now and then.
What I want to do though is when ever I come out of feed mode or water change mode or any mode where the return pump is shut off, I want it to run for an hour as well. Is there a way to do this?
Thanks.
Also is there a way to puul the code from the controller into Arduino or does it only go from PC to controller?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Yes, we can come up with a custom function for you.
Unfortunately, there is not way back from controller to Arduino.
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Try this:

Code: Select all

#include <Salinity.h>
#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

void setup()
{
  ReefAngel.Init();  
  ReefAngel.FeedingModePorts=Port8Bit;
  ReefAngel.WaterChangePorts=Port8Bit;
  ReefAngel.Relay.On(Port8);
}

void loop()
{
  BackSiphon(Port8,Port1);
  ReefAngel.ShowInterface();
}

void BackSiphon(byte MonitorPort, byte BackSiphonPort)
{
  static byte laststatus=0;
  static unsigned long lastnow=now();
  byte currentstatus=ReefAngel.Relay.Status(MonitorPort);
  
  if (laststatus!=currentstatus)
  {
    laststatus=currentstatus;
    if (currentstatus) lastnow=now();
  }
  ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<5);
}
Roberto.
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Sorry maybe a bit more info on what I need done. I have an aqualifter on the HOB overflow. I run that for an hour every morning.
I have it plugged into port 3 on my relay.
Will this code still let it run for an hour every morning?
Sorry..
Image
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Here's my code with your code worked in. Did I do it correctly? Im a real newb at this.

// Autogenerated file by RAGen (v1.2.2.171), (06/11/2012 09:50)
// RA_061112_0950.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define wifi
#define WDT
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 5
#define ENABLE_ATO_LOGGING
#define IOEXPANSION
*/


#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 <IO.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above 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 = "Lights On";
prog_char menu4_label[] PROGMEM = "Lights Off";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label };

void MenuEntry1()
{
ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
ReefAngel.Relay.RelayMaskOnE = ReefAngel.LightsOnPortsE;
ReefAngel.DisplayMenuEntry("Lights On");
}
#endif // RelayExp
ReefAngel.Relay.Write();

}
void MenuEntry5()
{
ReefAngel.Relay.RelayMaskOn = 0;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
ReefAngel.Relay.RelayMaskOnE = 0;
}
#endif // RelayExp
ReefAngel.Relay.Write();

}


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Initialize the custom menu
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit | Port7Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;

// Ports that are always on
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
ReefAngel.Relay.On(Port8);

//Adds Wifi function
ReefAngel.AddWifi();
////// Place additional initialization code below here
ReefAngel.FeedingModePorts=Port8Bit;
ReefAngel.WaterChangePorts=Port8Bit;
ReefAngel.Relay.On(Port8);


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

void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.SingleATO(true,Port1,25,0); //ATO time out 25 seconds once every hour
ReefAngel.StandardLights(Port2,19,0,6,0); //Refugium Light on at 7PM off at 6AM
ReefAngel.StandardLights(Port3,6,0,7,0); //Overflow pump on at 6AM off at 7PM
ReefAngel.StandardLights(Port4);
ReefAngel.Relay.DelayedOn(Port7, 5); //Skimmer
////// Place your custom code below here
BackSiphon(Port8,Port3);
ReefAngel.ShowInterface();
}
void BackSiphon(byte MonitorPort, byte BackSiphonPort)
{
static byte laststatus=0;
static unsigned long lastnow=now();
byte currentstatus=ReefAngel.Relay.Status(MonitorPort);

if (laststatus!=currentstatus)
{
laststatus=currentstatus;
if (currentstatus) lastnow=now();
}
ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<5);



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

// This should always be the last line
ReefAngel.ShowInterface();
}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Yeah, I think that should work.
Can you test and report back?
Roberto.
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

It works, but only stays on for a few seconds. I would like it to run an hour then shut off. I was hoping for an hour run time.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Oh, I'm sorry.
I just reduced it dramatically for testing and to make sure it is working correctly

Code: Select all

ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<5);
Just change the 5 to the number of seconds you want it to run.
Roberto.
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

No appologies needed. You do Amazing work and I am grateful. I was trying to figure out where the time value was on my own. I hate to be a bother.
Thanks!!
Image
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Ok, so can someone look at my code. I've been playing with it and when in feeding or water change mode ports 5&6 are supposed to shut off, but don't. Also, when in Lights On/Off mode the screen goes blank. How can I make it show Light On Mode or Lights Off mode?
Did I screw up my code?
Thanks

Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (06/11/2012 09:50)
// RA_061112_0950.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define wifi
#define WDT
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 5
#define ENABLE_ATO_LOGGING
#define IOEXPANSION
*/


#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 <IO.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above 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 = "Lights On";
prog_char menu4_label[] PROGMEM = "Lights Off";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label  };

void MenuEntry1()
{
ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
    ReefAngel.Relay.RelayMaskOnE[i] = ReefAngel.LightsOnPortsE[i];
    ReefAngel.DisplayMenuEntry("Lights On");
}
#endif  // RelayExp
ReefAngel.Relay.Write();

}
void MenuEntry5()
{
ReefAngel.Relay.RelayMaskOn = 0;
#ifdef RelayExp
for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
{
    ReefAngel.Relay.RelayMaskOnE[i] = 0;
}
#endif  // RelayExp
ReefAngel.Relay.Write();

}


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Initialize the custom menu
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    //Light On/Off Ports
    ReefAngel.LightsOnPorts = Port2Bit;

    // Ports that are always on
    
    ReefAngel.Relay.On(Port8);  //Return Pump
    
    //Adds Wifi function
    ReefAngel.AddWifi();
    ////// Place additional initialization code below here
    ReefAngel.FeedingModePorts=Port8Bit;
    ReefAngel.WaterChangePorts=Port8Bit;
    ReefAngel.Relay.On(Port8);


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

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.SingleATO(true,Port1,25,1);  //ATO time out 25 seconds once every hour
    ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
    ReefAngel.StandardLights(Port3,6,0,7,0);  //Overflow pump on at 6AM off at 7PM
    ReefAngel.StandardLights(Port4);  // Nothing yet
    ReefAngel.StandardLights(Port5,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
    ReefAngel.StandardLights(Port6,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
    ReefAngel.Relay.DelayedOn(Port7, 5);  //Skimmer
    ////// Place your custom code below here
    BackSiphon(Port8,Port3);
    ReefAngel.ShowInterface();
}
void BackSiphon(byte MonitorPort, byte BackSiphonPort)
{
  static byte laststatus=0;
  static unsigned long lastnow=now();
  byte currentstatus=ReefAngel.Relay.Status(MonitorPort);
  
  if (laststatus!=currentstatus)
  {
    laststatus=currentstatus;
    if (currentstatus) lastnow=now();
  }
  ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<300);

    

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

    // This should always be the last line
    ReefAngel.ShowInterface();
}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Try this:

Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (06/11/2012 09:50)
// RA_061112_0950.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
 #define wifi
 #define WDT
 #define CUSTOM_MENU
 #define CUSTOM_MENU_ENTRIES 5
 #define ENABLE_ATO_LOGGING
 #define IOEXPANSION
 */


#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 <IO.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above 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 = "Lights On";
prog_char menu4_label[] PROGMEM = "Lights Off";
PROGMEM const char *menu_items[] = {
  menu0_label, menu1_label, menu2_label, menu3_label, menu4_label  };

void MenuEntry1()
{
  ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
  ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
  ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
#ifdef RelayExp
  for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
  {
    ReefAngel.Relay.RelayMaskOnE[i] = ReefAngel.LightsOnPortsE[i];
  }
#endif  // RelayExp
  ReefAngel.Relay.Write();
  ReefAngel.DisplayMenuEntry("Lights On");

}
void MenuEntry5()
{
  ReefAngel.Relay.RelayMaskOn = 0;
#ifdef RelayExp
  for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
  {
    ReefAngel.Relay.RelayMaskOnE[i] = 0;
  }
#endif  // RelayExp
  ReefAngel.Relay.Write();
  ReefAngel.DisplayMenuEntry("Lights Off");

}


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  // Initialize the custom menu
  ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
  //Light On/Off Ports
  ReefAngel.LightsOnPorts = Port2Bit;

  // Ports that are always on

  ReefAngel.Relay.On(Port8);  //Return Pump

  //Adds Wifi function
  ReefAngel.AddWifi();
  ////// Place additional initialization code below here
  ReefAngel.Relay.On(Port8);


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

void loop()
{
  // Specific functions that use Internal Memory values
  ReefAngel.SingleATO(true,Port1,25,1);  //ATO time out 25 seconds once every hour
  ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
  ReefAngel.StandardLights(Port3,6,0,7,0);  //Overflow pump on at 6AM off at 7PM
  ReefAngel.StandardLights(Port4);  // Nothing yet
  ReefAngel.StandardLights(Port5,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
  ReefAngel.StandardLights(Port6,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
  ReefAngel.Relay.DelayedOn(Port7, 5);  //Skimmer
  ////// Place your custom code below here
  BackSiphon(Port8,Port3);
  ////// Place your custom code above here

  // This should always be the last line
  ReefAngel.ShowInterface();
}

void BackSiphon(byte MonitorPort, byte BackSiphonPort)
{
  static byte laststatus=0;
  static unsigned long lastnow=now();
  byte currentstatus=ReefAngel.Relay.Status(MonitorPort);

  if (laststatus!=currentstatus)
  {
    laststatus=currentstatus;
    if (currentstatus) lastnow=now();
  }
  ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<300);
}

Roberto.
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Thanks Roberto awesome job.
Now that everythign works the way I like it, Time to tackle the auto ATO refill. The jumpers needed for the main board are just regular PC bord jumpers, yes?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

yeah
Roberto.
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Ok, this works awesome, but I need a little more control over the overflow's pump. Can we add another item to the menu that says "Overflow Clear" that, when selected, will run port 3 for like 2 minutes?
I would like to clear out the air in between feedings and water changes or whenever I might need to.
Thanks!!
Image
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Re: over flow siphon

Post by Spotted »

Also can I run 2 return pumps on 1 port? I have a Mag 9.5 and a Mag 12 that I want to run on the same port 8. Will the port handle it?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: over flow siphon

Post by rimai »

Try this:

Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (06/11/2012 09:50)
// RA_061112_0950.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define wifi
 #define WDT
 #define CUSTOM_MENU
 #define CUSTOM_MENU_ENTRIES 5
 #define ENABLE_ATO_LOGGING
 #define IOEXPANSION
 */


#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 <IO.h>
#include <ReefAngel.h>

////// Place global variable code below here
unsigned long clearsiphon=now();

////// Place global variable code above 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 = "Lights On";
prog_char menu4_label[] PROGMEM = "Lights Off";
prog_char menu5_label[] PROGMEM = "Clear Siphon";
PROGMEM const char *menu_items[] = {
  menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label  };

void MenuEntry1()
{
  ReefAngel.FeedingModeStart();

}
void MenuEntry2()
{
  ReefAngel.WaterChangeModeStart();

}
void MenuEntry3()
{
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
  ReefAngel.Relay.RelayMaskOn = ReefAngel.LightsOnPorts;
#ifdef RelayExp
  for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
  {
    ReefAngel.Relay.RelayMaskOnE[i] = ReefAngel.LightsOnPortsE[i];
  }
#endif  // RelayExp
  ReefAngel.Relay.Write();
  ReefAngel.DisplayMenuEntry("Lights On");

}
void MenuEntry5()
{
  ReefAngel.Relay.RelayMaskOn = 0;
#ifdef RelayExp
  for ( byte i = 0; i < MAX_RELAY_EXPANSION_MODULES; i++ )
  {
    ReefAngel.Relay.RelayMaskOnE[i] = 0;
  }
#endif  // RelayExp
  ReefAngel.Relay.Write();
  ReefAngel.DisplayMenuEntry("Lights Off");

}

void MenuEntry6()
{
  clearsiphon=now();
  ReefAngel.DisplayedMenu=RETURN_MAIN_MODE;
}


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  // Initialize the custom menu
  ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));

  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
  //Light On/Off Ports
  ReefAngel.LightsOnPorts = Port2Bit;

  // Ports that are always on

  ReefAngel.Relay.On(Port8);  //Return Pump

  //Adds Wifi function
  ReefAngel.AddWifi();
  ////// Place additional initialization code below here
  ReefAngel.Relay.On(Port8);


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

void loop()
{
  // Specific functions that use Internal Memory values
  ReefAngel.SingleATO(true,Port1,25,1);  //ATO time out 25 seconds once every hour
  ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
  ReefAngel.StandardLights(Port3,6,0,7,0);  //Overflow pump on at 6AM off at 7PM
  ReefAngel.StandardLights(Port4);  // Nothing yet
  ReefAngel.StandardLights(Port5,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
  ReefAngel.StandardLights(Port6,6,0,22,0);  //Turn off powerheads from 10PM to 6AM
  ReefAngel.Relay.DelayedOn(Port7, 5);  //Skimmer
  ////// Place your custom code below here
  if (now()%clearsiphon<120)
    ReefAngel.Relay.On(Port3);  
  else
   BackSiphon(Port8,Port3);
 

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

  // This should always be the last line
  ReefAngel.ShowInterface();
}

void BackSiphon(byte MonitorPort, byte BackSiphonPort)
{
  static byte laststatus=0;
  static unsigned long lastnow=now();
  byte currentstatus=ReefAngel.Relay.Status(MonitorPort);

  if (laststatus!=currentstatus)
  {
    laststatus=currentstatus;
    if (currentstatus) lastnow=now();
  }
  ReefAngel.Relay.Set(BackSiphonPort,now()%lastnow<300);
}

You should be fine with 2 pumps on the same port.
Roberto.
Post Reply