My code: Random Wavemaker

New members questions
Post Reply
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

My code: Random Wavemaker

Post by rossbryant1956 »

Pls take a look at this code. My first custom effort. Thx in advance.
----------------------------------------------------

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (02/01/2012 21:20)
// RA_020112_2120.pde
// Current working version of production code
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define wifi
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
    randomSeed(analogRead(0));
    ReefAngel.Timer[1].SetInterval(random(15,35));
    ReefAngel.Timer[1].Start(); 
    ReefAngel.Relay.On(Port4);  
}

void loop()
{
    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.Wavemaker1(Port4);
    ReefAngel.Wavemaker2(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardHeater(Port7);
      if ( ReefAngel.Timer[1].IsTriggered() )
  {
        ReefAngel.Timer[1].SetInterval(random(15,35));
        ReefAngel.Timer[1].Start();
        ReefAngel.Relay.Toggle(Port4);
        ReefAngel.Relay.Toggle(Port5);
  }

    ReefAngel.ShowInterface();
}
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: My code: Random Wavemaker

Post by rimai »

I recommend moving the wavemakers to 5 and 6.
Use this instead:

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (02/01/2012 21:20)
// RA_020112_2120.pde
// Current working version of production code
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define wifi
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
    randomSeed(analogRead(0));
    ReefAngel.Timer[1].SetInterval(random(15,35));
    ReefAngel.Timer[1].Start(); 
    ReefAngel.Relay.On(Port5);  
}

void loop()
{
    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.StandardFan(Port4);
    ReefAngel.StandardHeater(Port7);
      if ( ReefAngel.Timer[1].IsTriggered() )
  {
        ReefAngel.Timer[1].SetInterval(random(15,35));
        ReefAngel.Timer[1].Start();
        ReefAngel.Relay.Toggle(Port5);
        ReefAngel.Relay.Toggle(Port6);
  }

    ReefAngel.ShowInterface();
}

Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: My code: Random Wavemaker

Post by rossbryant1956 »

Hey Roberto;

This works beautifully except when I put it in feeding mode it turns off 4,5, and 8. Six keeps working. What line do I need to add to change this to 5,6, and 8. Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: My code: Random Wavemaker

Post by rimai »

Simply add this inside the setup() function:

Code: Select all

    ReefAngel.FeedingModePorts = B10110000;
Roberto.
Post Reply