I wrote/copied some code for my custom main screen which ended up pretty nice, but I cant seem to get the code right to show my float switch status on the main screen.
Anyone have some code that I can use to copy in my code that can show this?
My current custom screen:
How I want it to look (more or less. Not fussy about looks, just want to see float status):
My custom screen code:
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; // MENU_START_ROW is 10, according to globals.h, so y=2+10+1=13
ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x, y+5, "Pico Temp PH");
ConvertNumToString(text, ReefAngel.Params.PH, 100); // Get pH reading and convert
ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+75, y+18, text, Font8x16); // Put pH on the screen
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10); // Get T1 temp and convert
y += MENU_START_ROW*1.3;
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*1.2;
ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x, 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*1.2;
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