Is the pinout standard on the svga cable? I probably have a few laying around if you think that's worth a shot.
I use RA+, original wifi module, and the dimming expansion. New currently revised code is below.
Code: Select all
#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 <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>
#include <Moon.h>
////// Place global variable code below here
boolean RST;
byte DCPSpeed = 90;
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.AddStandardMenu(); // Add Standard Menu
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port4Bit | Port7Bit | Port8Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
////// Place additional initialization code below here
// initialize default values for Custom Variables
RST = true; // initialize reset flag to true for calculations
////// Place additional initialization code above here
}
void loop()
{
// Initialize moon calculations with longitude and latitude
moon_init(-92.2387228, 30.3655939);
ReefAngel.DosingPumpRepeat3( Port1 ); //Calcium Drip if PH is less than 8.4 // Currently set to 7 sec every 240 minutes
if (ReefAngel.Params.PH < 840) {
ReefAngel.DosingPumpRepeat1( Port2 ); //Alkalinity Drip // Currently set to 7 sec every 240 minutes
}
ReefAngel.Relay.DelayedOn( Port4 ); //Reef Octopus Skimmer
ReefAngel.StandardLights( Port5 ); //LED Fans
ReefAngel.Relay.Set( Port6, !ReefAngel.Relay.Status( Port5 ) ); //Fuge Light
ReefAngel.StandardHeater( Port7 );
ReefAngel.StandardATO( Port8 );
// Dimming Channel Functions
ReefAngel.PWM.SetActinic( DCPSpeed );
ReefAngel.PWM.SetChannel( 0, PWMParabola( Moon.riseH, Moon.riseM, Moon.setH, Moon.setM, 0, MoonPhase(), 0 ) );
ReefAngel.PWM.Channel1PWMSlope(); //Right & Left Philips Rebel ES Royal Blue and Cool White & UV & Cree XT-E Green
ReefAngel.PWM.Channel2PWMSlope(); //Right Daylight Cree XP-G2 R5 Cool White
ReefAngel.PWM.Channel3PWMSlope(InternalMemory.ActinicOffset_read()); //Right Actinic Cree XT-E Royal Blue
ReefAngel.PWM.Channel4PWMSlope(); //Left Daylight Cree XP-G2 R5 Cool White
ReefAngel.PWM.Channel5PWMSlope(InternalMemory.ActinicOffset_read()); //Left Actinic Cree XT-E Royal Blue
////// Place your custom code below here
//PWM Expansion Channels = 0 if Overheat of if 1 hour after sunset or 1 hour before sunrise
if ((hour(now())>=(InternalMemory.StdLightsOffHour_read()+1) || hour(now())<InternalMemory.StdLightsOnHour_read()) || (ReefAngel.isOverheat())) {
ReefAngel.PWM.SetChannel (1,0);
ReefAngel.PWM.SetChannel (2,0);
ReefAngel.PWM.SetChannel (3,0);
ReefAngel.PWM.SetChannel (4,0);
ReefAngel.PWM.SetChannel (5,0);
}
if (ReefAngel.isLightsOnMode()) {
ReefAngel.PWM.SetChannel(2,15);
ReefAngel.PWM.SetChannel(3,15);
ReefAngel.PWM.SetChannel(4,15);
ReefAngel.PWM.SetChannel(5,15);
}
if (ReefAngel.isWaterChangeMode()) {
ReefAngel.Relay.On( Port6 );
ReefAngel.PWM.SetActinic( 0 );
}
// moonlight on between sunset hour and sunrise hour
//if (hour(now())>=(InternalMemory.StdLightsOffHour_read()-1) || hour(now())<=InternalMemory.StdLightsOnHour_read()+1) ReefAngel.PWM.SetChannel (0, (map(MoonPhase(), 0,100,10,25)));
//else ReefAngel.PWM.SetChannel (0,0);
//Custom Variables and Calculations for Dosing and Lighting Durations
//if (RST == true) {
if ( (now()%86400==3600) || RST == true ) {
int DailyCalc = ((InternalMemory.DP2Timer_read()) * (1440 / InternalMemory.DP2RepeatInterval_read())); //Calc ml/day
int DailyAlk = ((InternalMemory.DP1Timer_read()) * (1440 / InternalMemory.DP1RepeatInterval_read())); //Alk ml/day
if (DailyCalc!=ReefAngel.CustomVar[0]) ReefAngel.CustomVar[0]=DailyCalc;
if (DailyAlk!=ReefAngel.CustomVar[1]) ReefAngel.CustomVar[1]=DailyAlk;
RST = false;
}
if (ReefAngel.LowATO.IsActive() == 1 ) {
ReefAngel.CustomVar[2]=1;
}
if (ReefAngel.CustomVar[3] == 1 ) {
ReefAngel.CustomVar[2] = 0;
ReefAngel.CustomVar[3] = 0;
}
////// Place your custom code above here
ReefAngel.Portal( "clw143" );
// This should always be the last line
ReefAngel.ShowInterface();
}
////// Place your custom functions below here
////// Place your custom functions above here
// RA_STRING1=gKt/ikl5qt+yGq8DMDq1tQ==::NTdkYmJkMzM0ODdmMmE0NA==
// RA_STRING2=
// RA_STRING3=
// RA_LABEL LABEL_PORT1=Calc
// RA_LABEL LABEL_PORT2=Alk
// RA_LABEL LABEL_PORT4=Skimmer
// RA_LABEL LABEL_PORT5=LED Fans
// RA_LABEL LABEL_PORT6=Fuge Light
// RA_LABEL LABEL_PORT7=Heater
// RA_LABEL LABEL_PORT8=ATO Pump
// RA_LABEL LABEL_PWME0=Moon Light
// RA_LABEL LABEL_PWME1=Combined
// RA_LABEL LABEL_PWME2=Daylight R
// RA_LABEL LABEL_PWME3=Blue Right
// RA_LABEL LABEL_PWME4=Daylight L
// RA_LABEL LABEL_PWME5=Blue Left
// WIZARD_CONFIG_JSON={"board":"plus","memory":"memory","tempUnit":"fahrenheit","overHeatTemp":"82","overHeatTempProbe":"T1","dimmingExpansion":true,"wifiAttachment":true,"dimmingData":{"standardDimming":[{"number":1,"name":"Daylight","waveform":"none","settings":{"startTime":"","startPercent":"","duration":"","endTime":"","endPercent":""}},{"number":2,"name":"Actinic","waveform":"static","settings":{"startTime":"","startPercent":"","duration":"","endTime":"","endPercent":"","staticValue":90}}],"moonSettings":{"longitude":-92.2387228,"latitude":30.3655939},"dimmingExpansion":[{"number":0,"waveform":"moonphase","advancedMoon":true,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}},{"number":1,"waveform":"slope","advancedMoon":false,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}},{"number":2,"waveform":"slope","advancedMoon":false,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}},{"number":3,"waveform":"slope","advancedMoon":false,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}},{"number":4,"waveform":"slope","advancedMoon":false,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}},{"number":5,"waveform":"slope","advancedMoon":false,"settings":{"startTime":"","startPercent":"","duration":0,"endTime":"","endPercent":""}}]},"mainRelayPorts":[{"function":"dosing","settings":{"dosingOffset":"10","dependsOn":false,"conditionalParameter":"ph","conditionalOperator":"<","conditionalValue":"840","waterChangeOverride":true}},{"function":"dosing","settings":{"dosingOffset":"0","dependsOn":true,"conditionalParameter":"ph","conditionalOperator":"<","conditionalValue":"840","waterChangeOverride":true}},{"function":"notused","settings":{"dosingOffset":"0"}},{"function":"delayed","settings":{"dosingOffset":"0","waterChangeOverride":true}},{"function":"timeschedule","settings":{"dosingOffset":"0"}},{"function":"opposite","settings":{"dosingOffset":"0","useMemory":false,"oppositePort":"main-5","dependsOn":false}},{"function":"heater","settings":{"dosingOffset":"0","heaterProbe":"T1","waterChangeOverride":true,"overHeatOverride":true}},{"function":"topoff","settings":{"dosingOffset":"0","waterChangeOverride":true}}],"labels":{"LABEL_PORT1":"Calc","LABEL_PORT2":"Alk","LABEL_PORT4":"Skimmer","LABEL_PORT5":"LED Fans","LABEL_PORT6":"Fuge Light","LABEL_PORT7":"Heater","LABEL_PORT8":"ATO Pump","LABEL_PWME0":"Moon Light","LABEL_PWME1":"Combined","LABEL_PWME2":"Daylight R","LABEL_PWME3":"Blue Right","LABEL_PWME4":"Daylight L","LABEL_PWME5":"Blue Left"},"customCode":{"globalVariables":"byte DCPSpeed = 90;","initializationCode":"","customCode":"//PWM Expansion Channels = 0 if Overheat or Lights off\nif ((hour(now())>=(InternalMemory.StdLightsOffHour_read()+1) || hour(now())<InternalMemory.StdLightsOnHour_read()) || (ReefAngel.Params.Temp[T1_PROBE]>InternalMemory.OverheatTemp_read())) {\n ReefAngel.PWM.SetChannel (1,0);\n ReefAngel.PWM.SetChannel (2,0);\n ReefAngel.PWM.SetChannel (3,0);\n ReefAngel.PWM.SetChannel (4,0);\n ReefAngel.PWM.SetChannel (5,0);\n}\n\n // moonlight are on between sunset hour and sunrise hour\nif (hour(now())>=(InternalMemory.StdLightsOffHour_read()-1) || hour(now())<=InternalMemory.StdLightsOnHour_read()+1) ReefAngel.PWM.SetChannel (0, (map(MoonPhase(), 0,100,10,25)));\nelse ReefAngel.PWM.SetChannel (0,0);","customFunctions":""}}