Custom Main Screens

Would you like to help?
Share your walkthrough tutorial with others
User avatar
Posts: 2651
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Wed May 01, 2013 3:35 pm
I just fixed up my code in the previous post. I know the WHITE and Params errors should be gone now. I'm not sure why it is giving you the error about the WaterLevel member. It should be available because it found the Water Level Expansion Module.
Make sure you are running the latest libraries. Perhaps Roberto can shed some more light on this error.

Posts: 11973
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed May 01, 2013 3:42 pm
Make sure you add this in your includes up top:
Code: Select all
#include <WaterLevel.h>
Roberto.

Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa
PostPosted: Wed May 01, 2013 10:59 pm
Thanks guys, will give a shot in a bit later :)
Image

Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA
PostPosted: Wed May 15, 2013 10:45 pm
Code: Select all

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];
  static byte vtechmode=0;

  ReefAngel.LCD.DrawDate(6, 2);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 123, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 123, "|");


  ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");

  ReefAngel.LCD.DrawText(0,255,10,30,"Display");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params. PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
  pingSerial();

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);

  ReefAngel.LCD.DrawText(0,255,8,68,"Sump");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_CORNFLOWERBLUE, 99, 68, 10);

}
void DrawCustomGraph()
{
}


Is it possible to mod this code to display the mode that my WP40 is running?
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Thu May 16, 2013 7:39 am
That will display the mode your mp40 is running? Only if you're controlling it via the RF module? The RA sets the mode and then that code displays it on your custom main. I hope you have the RA+ or you'll run out of space quickly.
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative

Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA
PostPosted: Thu May 16, 2013 8:43 am
DrewPalmer04 wrote:That will display the mode your mp40 is running? Only if you're controlling it via the RF module? The RA sets the mode and then that code displays it on your custom main. I hope you have the RA+ or you'll run out of space quickly.


Yes, using this part of the coding.
Code: Select all
 ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");


I believe this only works with the RF module though. I want it to display the mode my WP40 are in, through the use of the wp40 harness and dimming ports. Yep, the plus was a must!
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison

Posts: 11973
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu May 16, 2013 9:26 am
You can do that.... Can you open a new thread and post your code?
Roberto.

Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA
PostPosted: Thu May 16, 2013 1:02 pm
It's not my code. Anther member posted it in this thread. I just wanted to change it up a litte bit. Should I still open another thread with it? Thanks
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
User avatar
Posts: 5337
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu May 16, 2013 1:27 pm
Yes, but post your code and that code seperately so we can see how it needs to be integrated.

Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA
PostPosted: Tue May 21, 2013 8:32 pm
After a day of tweaking the code I think i finally have it the way I like it.

Image

Code: Select all
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];

  ReefAngel.LCD.DrawDate(6, 4);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawLargeText(0,255,10,16,"  WP40 Mode:");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,27,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,26,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,26,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,26,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,26,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,26,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,26,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,255,45,26,"Night");

  ReefAngel.LCD.DrawLargeText(0,255,17,49,"Sump");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawHugeText(COLOR_RED, 255, 12, 65, text, Num12x16);
  pingSerial();

  ReefAngel.LCD.DrawLargeText(0,255,100,40,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLUE, 255, 89, 55, text, Num8x8);
  pingSerial();
 
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,89, "WP40L");
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,20,100, ReefAngel.PWM.GetDaylightValue());
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,88,89, "WP40R");
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,95,100, ReefAngel.PWM.GetActinicValue());

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 113, TempRelay);
 
 
}
void DrawCustomGraph()
{
}


I cant take credit, I mostly copied and pasted others codes from this thread.

Thanks!
Last edited by ReeferBee on Tue May 21, 2013 9:22 pm, edited 1 time in total.
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest