Wavemaker Help

Requests for new functions or software apps

Posts: 12309
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Oct 31, 2012 8:12 pm
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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here
unsigned long clearsiphon=now();
boolean NTM=false;
////// 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";
prog_char menu6_label[] PROGMEM = "Nutri Transp";

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.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 MenuEntry7()
{
   NTM=true; // Enable NTM mode
   ReefAngel.Timer[1].Start(); // Start timer for NTM 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 | Port4Bit;

  // 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);

  ReefAngel.Timer[1].SetInterval(900); // Timer for Nutrient Transport mode

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

void loop()
{
  // Specific functions that use Internal Memory values
  ReefAngel.SingleATO(true,Port1,120,1);  //ATO time out 2 minutes once every hour
  ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
  ReefAngel.StandardLights(Port3,7,0,19,0);  //Blue LED on at 7AM off at 7PM
  ReefAngel.StandardLights(Port4,8,0,18,0);  // Daylight on at 8AM off at 6PM
//  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);
 
ReefAngel.WavemakerRandom(Port5,60,90); // Port 5 on random wavemaker
 ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Port 6 is opposite of Port5

  if (ReefAngel.Timer[1].IsTriggered()) // if timer for NTM mode is expired
    NTM=false; // disable NTM mode
 
  if (NTM) // if we are on NTM mode, turn ports on
  {
    ReefAngel.Relay.On(Port5);
    ReefAngel.Relay.On(Port6);
  }
  ////// 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.

Posts: 101
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida
PostPosted: Wed Oct 31, 2012 8:52 pm
Almost working just right, I appreciate all the help.
When Nutri Trans is stopped, random wave function does not resume. All PH remain on. Also, I don't know if it's possible to still shut off all PH after 10 PM?
Also, the clear siphon function is no longer needed as I have put ports 3&4 on to lights. I think the clear siphon is interfering with the light function.
Actually I have run out of space on my bar and until I can save enough for an expansion, I gotta run the siphon manually..
Thanks again!!
Image

Posts: 101
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida
PostPosted: Wed Oct 31, 2012 8:55 pm
Wait, I just found time value for the nutri transport mode. I wil continue testing tomorrow. The lights still don't work right though, port 3 where the aqualifter was for the siphon on the overflow.
Thanks
Image

Posts: 12309
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Oct 31, 2012 9:40 pm
Yeah, the mode will last 15minutes (900seconds).
You can change it as you wish.
Try this one. I removed the siphon:
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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here
unsigned long clearsiphon=now();
boolean NTM=false;
////// 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";
prog_char menu6_label[] PROGMEM = "Nutri Transp";

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.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 MenuEntry7()
{
  NTM=true; // Enable NTM mode
  ReefAngel.Timer[1].Start(); // Start timer for NTM 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 | Port4Bit;

  // 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);

  ReefAngel.Timer[1].SetInterval(900); // Timer for Nutrient Transport mode

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

void loop()
{
  // Specific functions that use Internal Memory values
  ReefAngel.SingleATO(true,Port1,120,1);  //ATO time out 2 minutes once every hour
  ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
  ReefAngel.StandardLights(Port3,7,0,19,0);  //Blue LED on at 7AM off at 7PM
  ReefAngel.StandardLights(Port4,8,0,18,0);  // Daylight on at 8AM off at 6PM
  //  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


  ReefAngel.WavemakerRandom(Port5,60,90); // Port 5 on random wavemaker
  ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Port 6 is opposite of Port5

    if (ReefAngel.Timer[1].IsTriggered()) // if timer for NTM mode is expired
      NTM=false; // disable NTM mode

    if (NTM) // if we are on NTM mode, turn ports on
  {
    ReefAngel.Relay.On(Port5);
    ReefAngel.Relay.On(Port6);
  }
  ////// Place your custom code above here

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



Roberto.

Posts: 101
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida
PostPosted: Fri Nov 02, 2012 6:44 am
Ok, so this line

Code: Select all
 ReefAngel.WavemakerRandom(Port5,60,90); // Port 5 on random wavemaker


Is the line that says how long the PHs are on yes? Is it between 60 to 90 seconds? Just making sure so I can play with the timing. Thanks.

Awesome work.
Image

Posts: 12309
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Nov 02, 2012 7:46 am
yes :) between 60 and 90s
Roberto.

Posts: 101
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida
PostPosted: Fri Nov 02, 2012 7:39 pm
Is it not possible to get the PHs to shut off at 10PM? I wasn't able to test until tonight and they don't shut off.
Otherwise everything looks awesome.
Image

Posts: 12309
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Nov 02, 2012 8:12 pm
Yes, we can shut them off.
What time period do you want them off?
Roberto.

Posts: 101
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida
PostPosted: Sat Nov 03, 2012 4:17 am
10pm to 6 am
Image

Posts: 12309
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sat Nov 03, 2012 8:46 am
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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here
unsigned long clearsiphon=now();
boolean NTM=false;
////// 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";
prog_char menu6_label[] PROGMEM = "Nutri Transp";

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.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 MenuEntry7()
{
  NTM=true; // Enable NTM mode
  ReefAngel.Timer[1].Start(); // Start timer for NTM 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 | Port4Bit;

  // 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);

  ReefAngel.Timer[1].SetInterval(900); // Timer for Nutrient Transport mode

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

void loop()
{
  // Specific functions that use Internal Memory values
  ReefAngel.SingleATO(true,Port1,120,1);  //ATO time out 2 minutes once every hour
  ReefAngel.StandardLights(Port2,19,0,7,0);  //Refugium Light on at 7PM off at 6AM
  ReefAngel.StandardLights(Port3,7,0,19,0);  //Blue LED on at 7AM off at 7PM
  ReefAngel.StandardLights(Port4,8,0,18,0);  // Daylight on at 8AM off at 6PM
  //  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 (hour()>=22 || hour()<6)
  {
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.Off(Port6);
  }
  else
  {
    ReefAngel.WavemakerRandom(Port5,60,90); // Port 5 on random wavemaker
    ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Port 6 is opposite of Port5

      if (ReefAngel.Timer[1].IsTriggered()) // if timer for NTM mode is expired
        NTM=false; // disable NTM mode

      if (NTM) // if we are on NTM mode, turn ports on
    {
      ReefAngel.Relay.On(Port5);
      ReefAngel.Relay.On(Port6);
    }

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

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

Return to Requests

Who is online

Users browsing this forum: No registered users and 0 guests

cron