Lee,
Do you have the sample code you use for this... So that i can use it as a template. Would love to set it to get a wave action when needed... Once a day
ideally.. i want to do this with 3 MP40s:
Night mode: 10pm - 3am Master-S (SYNC), Slave S, Backwall, S
Lagoon mode 3-am-8am Master-S, Slave AS (Anti-Synch), Backwall, S
Reef Crest 8am- 11am Master-S, Slave S, Backwall, S
Tidal Swell 11- 4pm Master-S, Slave AS, Backwall, - Backwall
NTS Mode 4pm-7pm Master-S, Slave AS, Backwall, - Backwall
Lagoon Mode: 7pm-10pm Master-S, Slave AS, Backwall, - Sync
I also want the display and iphone to tell me what mode is on the display.
Any help would be greatly appreciated...
Code: Select all
On Sun, Sep 01, 2013 at 09:25 PM, Edwin Cambero wrote:
#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>fa
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.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.WaterChangePorts = Port1Bit | Port8Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
ReefAngel.FeedingModePorts = Port1Bit | Port6Bit | Port8Bit; // Turn off Ports 1, 6, 7 and 8 when Water Change Mode is activated
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit| Port5Bit;
ReefAngel.OverheatShutoffPorts = Port2Bit |Port3Bit | Port4Bit | Port5Bit | Port7Bit; // Turn off Ports 3,
ReefAngel.TempProbe = T3_PROBE;
ReefAngel.OverheatProbe = T3_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 825 );
// Setup ATO Port for AI communication
ReefAngel.AI.SetPort( lowATOPin );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.Relay.Set( Port2, !ReefAngel.Relay.Status( Port5 ) );
ReefAngel.StandardLights( Port3,11,0,16,0 );
ReefAngel.StandardLights( Port4,11,0,20,0 );
ReefAngel.StandardLights( Port5,9,0,19,0 );
ReefAngel.StandardHeater( Port7,800,810 );
ReefAngel.Relay.DelayedOn( Port8,2 ); //Skimmer
ReefAngel.AI.SetChannel( White, PWMParabola(11,0,17,0,0,75,0) );
ReefAngel.AI.SetChannel( Blue, PWMParabola(9,0,20,0,15,100,0) );
ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(9,0,20,0,15,100,(MoonPhase()/5)<3 ? 3:MoonPhase()/5) );
ReefAngel.RF.UseMemory = false;
ReefAngel.RF.SetMode( ReefCrest,85,10 );
ReefAngel.RF.SetChannel( Radion_White, PWMParabola(9,0,20,0,0,60,0) );
ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(9,0,20,0,15,65,15) );
ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(9,0,20,0,15,50,15) );
ReefAngel.RF.SetChannel( Radion_Blue, MoonPhase() );
ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(9,0,20,0,15,94,15) );
if ( second()==0 ) ReefAngel.RF.RadionWrite();
////// Place your custom code below here
ReefAngel.RF.UseMemory = false;
if (hour()>=6 && hour()<11)
ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=11 && hour()<13)
ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=13 && hour()<16)
ReefAngel.RF.SetMode(Smart_NTM,85,15);
else if (hour()>=16 && hour()<19)
ReefAngel.RF.SetMode(ReefCrest,65,10);
else
ReefAngel.RF.SetMode(Lagoon,40,10);
// Hardcode PH calibrations
//ReefAngel.PHMin=544; // PH7.0
//ReefAngel.PHMax=830; // PH10.0
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "ecam" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Aqua Illumination
x = 10;
y = 20;
//ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
// ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
// ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
// for ( int a=0;a<3;a++ )
// {
// ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
// x += 38;
// }
// pingSerial();
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 94, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{