random wavemaker spazzing out

Share you PDE file with our community
Post Reply
psyrob
Posts: 247
Joined: Thu Sep 01, 2011 8:44 pm

random wavemaker spazzing out

Post by psyrob »

I am using the random synch example code (ino below) and the wavemaker is spazzing out:

Port 5 goes on for 35-50 seconds, then switches off and back on really fast and stays on for another 8 seconds...then port 6 goes on for 35-50 seconds, then it switches off and back on really fast, stays on for another 8 or so seconds, then port 5 goes on for 35-50 seconds and so on and so on....

I just want it to be in synch, port 5 on for 35-50, then off while port 6 goes on for 35 to 50 while 5 is off...

thanks
//July 7, 2012, first try with the new 1.0.0 libraries

#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


////// 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 = Port5Bit | Port6Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit | Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;


// Ports that are always on

////// Place additional initialization code below here


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

void loop()
{
ReefAngel.DayLights( Port1 );
ReefAngel.ActinicLights( Port2 );
ReefAngel.DayLights( Port3 );
ReefAngel.DayLights( Port4 );
ReefAngel.Wavemaker1( Port5 );
ReefAngel.Wavemaker1( Port6 );
ReefAngel.StandardHeater( Port7 );
ReefAngel.StandardFan( Port8 );
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
ReefAngel.WavemakerRandom(Port5,35,50); // Turn Port5 on/off random cycles that lasts from 36 to 50 secs
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Turn Port6 on/off on opposite cycle as Port 5
// Port 5 and 6 are synchronized.
// They work in opposing motion of each other at random times.

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

// This should always be the last line
ReefAngel.Portal( "psyrob" );
ReefAngel.ShowInterface();
}
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: random wavemaker spazzing out

Post by binder »

Remove these lines:

Code: Select all

ReefAngel.Wavemaker1( Port5 );
ReefAngel.Wavemaker1( Port6 );
they are affecting the WavemakerRandom() function calls.
psyrob
Posts: 247
Joined: Thu Sep 01, 2011 8:44 pm

Re: random wavemaker spazzing out

Post by psyrob »

thanks curt...that did it...
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: random wavemaker spazzing out

Post by binder »

psyrob wrote:thanks curt...that did it...
awesome. :)
Post Reply