Thanks Steve & Lee! The code worked fantastic!!!
Sump + skimmer deactivated, Normal temps
Sump & skimmer active, Normal temps
Sump + skimmer deactivated, Low temps
Sump + skimmer deactivated, Overhead temps
Works like a charm. Thanks so much guys!!!
Here is the code if anyone wants to try.
Code: Select all
////// Place global variable code below here
int avgph[10];
unsigned long totalavgph=0;
byte avgindex=0;
void DrawCustomMain()
{
byte x;
byte y = 2;
char text[7];
// *********** CHANGE TEMP READOUT COLOR DEPENDENT ON FAN AND HEATER STATUS ***********
int TempColor; // Color for drawing temperature
boolean FanOn = ReefAngel.Relay.Status(Port7); // Get the status of the fan relay
boolean HeatOn = ReefAngel.Relay.Status(Port6); // Get the status of the heater relay
if (HeatOn)
{
TempColor = COLOR_NAVY; // Blue text, too cold, heater is on
}
if (FanOn)
{
TempColor = COLOR_RED; // Red text, too warm, fan is on
}
if (!HeatOn && !FanOn)
{
TempColor = COLOR_GREEN; // Green text, no fan or heater on
}
// ***********************************************************************************
ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 30, 2, "CJ's PICO REEF"); // Put a banner at the top
ReefAngel.LCD.DrawDate(6, 119); // Put the date and time at the bottom
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11); // Draw a black line under the banner
x = 6;
y += MENU_START_ROW*1.0; // MENU_START_ROW is 10, according to globals.h, so y=2+10+1=13
ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x, y+1, "Pico Temp PH");
x = 6;
y = MENU_START_ROW*0.8;
ConvertNumToString(text, ReefAngel.Params.PH, 100); // Get pH reading and convert
ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+73, y+12, text, Font8x16); // Put pH on the screen
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10); // Get T1 temp and convert
x = 6;
y += MENU_START_ROW*1.3;
ReefAngel.LCD.DrawHugeNumbers(COLOR_WHITE, TempColor, x, y, text); // Draw the temperature, white numbers on a colored background
x += 6;
y += MENU_START_ROW*1.2;
ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x-6, y+5, "Room Temp");
ConvertNumToString(text, ReefAngel.Params.Temp[T2_PROBE], 10); // Get T2 temp and convert
y += MENU_START_ROW*1.2;
x = 6;
ReefAngel.LCD.DrawHugeNumbers(COLOR_WHITE, TempColor, x, y, text); // Draw the temperature, white numbers on a colored background
x += 6;
y += MENU_START_ROW*2.2;
ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,25,y,"Sump Level",Font8x8); // Draw the Float switch status
if (ReefAngel.HighATO.IsActive()) {
ReefAngel.LCD.FillCircle(15,y+3,7,COLOR_RED);
} else {
ReefAngel.LCD.FillCircle(15,y+3,7,COLOR_GREEN);
}
x += 6;
y += MENU_START_ROW*1.6;
ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,25,y,"Skimmer Cup",Font8x8);
if (ReefAngel.LowATO.IsActive()) {
ReefAngel.LCD.FillCircle(15,y+3,7,COLOR_RED);
} else {
ReefAngel.LCD.FillCircle(15,y+3,7,COLOR_GREEN);
}
byte TempRelay = ReefAngel.Relay.RelayData; // Code for drawing the relay box
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 100, TempRelay);
}
void DrawCustomGraph()
{
}
////// Place global variable code above here