It seems I'm having no end of fun with this controller. I find myself thinking of new things it could do all the time. Too bad I don't have an ounce of programming skills to back it up, but I'm trying.
I started a custom main to do a couple simple things. First the colors of the data change from black to orange and then red if the data exceeds my targets for temp and pH. The second was to show the wavemakers on the main screen. I don't really understand the ReefAngel.Relay function and bit managment. Could someone help me to query whether port5 or port 6 is on so I can change the text with that status? (At some point it would be nice to show the actual timer as well. ) Here is the draft code and a picture of the screen.
Code: Select all
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
pingSerial();
// Display the T1 temperature at 5,5
ReefAngel.LCD.DrawText(T1TempColor,DefaultBGColor,5,13,"TK:");
if (ReefAngel.Params.Temp1>830) ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp1, COLOR_RED, 23, 13, 10);
else if (ReefAngel.Params.Temp1>810) ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp1, COLOR_ORANGE, 23, 13, 10);
else ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp1, COLOR_BLACK, 23, 13, 10);
// Display the T2 temperature at 5,5
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor,5,23,"RM:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_BLACK, 23, 23, 10);
// Display the T3 temperature at 5,5
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,5,33,"SP:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, COLOR_BLACK, 23, 33, 10);
// Display the PH at 20,5
ReefAngel.LCD.DrawText(PHColor,DefaultBGColor, 64, 13,"PH:");
if (ReefAngel.Params.PH>8.3 || ReefAngel.Params.PH<8.0) ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, COLOR_ORANGE, 82, 13, 100);
else if (ReefAngel.Params.PH>8.4 || ReefAngel.Params.PH<7.9) ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, COLOR_RED, 82, 13, 100);
else ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, COLOR_BLACK, 82, 13, 100);
// Display the Actinic PWM channel at 30,5 used for Moonlight
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor, 64, 23,"MN:");
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor, 90, 23,"%");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(), COLOR_BLACK, 82, 23, 1);
//Arrows for Wavemaker
ReefAngel.LCD.DrawText(DPColor,DefaultBGColor, 64, 33,"WV:");
// if (ReefAngel.Relay xxxx) ReefAngel.LCD.DrawText(APColor,DefaultBGColor, 82, 33,"-->"); //port 5 on
// else if (ReefAngel.Relay xxxx) ReefAngel.LCD.DrawText(APColor,DefaultBGColor, 78, 33,"<--"); //port 6 on
// else (ReefAngel.Relay xxxx) ReefAngel.LCD.DrawText(APColor,DefaultBGColor, 78, 33," O "); //port5 and port 6 off, wavemaker delay
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 43, TempRelay);
}
void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph(1, 75);
}