the VGA cable disconnected its the only method i found to get the relay box to normal activity. Like a reboot.
#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 <ReefAngel.h>
////// Place global variable code below here
int avgph[10];
unsigned long totalavgph=0;
byte avgindex=0;
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.UseFlexiblePhCalibration();
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port3Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port6Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port6Bit | Port4Bit | Port5Bit | Port7Bit | Port8Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port7Bit ;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 830 );
// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Port5 );
////// Place additional initialization code below here
for (int a=0;a<10;a++) avgph[a]=analogRead(PHPin);
////// Place additional initialization code above here
}
void loop()
{
totalavgph=0;
avgph[avgindex]=analogRead(PHPin);
avgindex++;
if (avgindex==10) avgindex=0;
for (int a=0;a<10;a++)
totalavgph+=avgph[a];
totalavgph/=10;
totalavgph=map(totalavgph, ReefAngel.PHMin, ReefAngel.PHMax, 700, 1000); // apply the calibration to the sensor reading
totalavgph=constrain(totalavgph,100,1400);
if (totalavgph <= 639) ReefAngel.Relay.Off(Port3);
if (totalavgph >= 652) ReefAngel.Relay.On(Port3);
ReefAngel.Relay.DelayedOn( Port2 );
// ReefAngel.CO2Control( Port3,644,655 );
ReefAngel.StandardFan( Port4,780,788 );
ReefAngel.StandardLights( Port7,0,30,12,30 );
ReefAngel.WavemakerRandom( Port6,1200,240 );
ReefAngel.StandardLights( Port8,12,0,2,0 );
ReefAngel.PWM.SetDaylight(PWMSlope(17,0,0,3,0,12,3,0));
ReefAngel.PWM.SetDaylight(PWMSlope(18,30,22,33,12,45,3,ReefAngel.PWM.GetDaylightValue()));
ReefAngel.PWM.SetActinic( PWMSlope(15,0,1,0,9,60,60,9) );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Bo0sted_Rafi" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
byte x = 6;
byte y = 2;
byte t;
char text[7];
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
pingSerial();
ReefAngel.LCD.DrawText(0,255,3,17," Rafi's 75 Reef");
pingSerial();
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 6, 90, "--------------------");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 6, 126, "--------------------");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 2, 93, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 2, 103, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 2, 113, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 2, 123, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 126, 93, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 126, 103, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 126, 113, "|");
ReefAngel.LCD.DrawText(COLOR_BLACK,255, 126, 123, "|");
ReefAngel.LCD.DrawText(0,255,10,30,"Display");
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 10, 40, text);
pingSerial();
ReefAngel.LCD.DrawText(0,255,90,30,"CA pH");
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 95, 40, text);
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);
pingSerial();
ReefAngel.LCD.DrawText(0,255,8,100, "White");
ReefAngel.LCD.DrawText(COLOR_BLACK,255,15,119, ReefAngel.PWM.GetDaylightValue());
ReefAngel.LCD.DrawText(0,255,88,100, "Blue");
ReefAngel.LCD.DrawText(COLOR_BLACK,255,90,119, ReefAngel.PWM.GetActinicValue());
}
void DrawCustomGraph()
{
}