Custom Main Screens

Would you like to help?
Share your walkthrough tutorial with others
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

Image

Code: Select all

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  Wire.requestFrom(8,8);
  for (int a=0;a<8;a++)
  {
    if (Wire.available()) SeasonsVar[a]=Wire.receive();
  }

  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(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.Temp1, 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.Temp3, COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_CORNFLOWERBLUE, 99, 68, 10);

  ReefAngel.LCD.DrawText(0,255,8,97,"Moon");
  DayAge = MoonAge(day(), month(), year());
  MoonState(DayAge);
  if (ThisPhase == 0) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"New");
  else if (ThisPhase == 1) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Crescent");
  else if (ThisPhase == 2) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"First Quarter");
  else if (ThisPhase == 3) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Gibbous");
  else if (ThisPhase == 4) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Full");
  else if (ThisPhase == 5) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Gibbous");
  else if (ThisPhase == 6) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Last Quarter");
  else if (ThisPhase == 7) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Crescent");

  //  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),COLOR_CORNFLOWERBLUE, 105, 109, 1);  

  ReefAngel.LCD.DrawText(0,255,8,109, "Sunrise");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,119, SeasonsVar[1]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,20,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,25,119, SeasonsVar[2]);

  ReefAngel.LCD.DrawText(0,255,75,109,"%");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255, 60, 109, SeasonsVar[0]);

  ReefAngel.LCD.DrawText(0,255,88,109, "Sunset");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,90,119, SeasonsVar[3]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,102,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,107,119, SeasonsVar[4]); 
}
void DrawCustomGraph()
{
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom Main Screens

Post by rimai »

I love this screen!!!
Roberto.
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

Thanks man, I worked on it all day haha, nudging each thing around to make it perfect - ps all of the ecotech modes are centered when theyre called and the color of the vortech mode matches the driver
wolfador
Posts: 241
Joined: Sun Sep 04, 2011 9:59 am
Location: Pittsburgh, PA

Re: Custom Main Screens

Post by wolfador »

very nice screen!
John
ReefAngel and ReefAngel-HD developer
If the RA iOS app has helped please consider a donation
Image
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

Re: Custom Main Screens

Post by psyrob »

Great screen!! Hey, where in your code does it make the relay box be blue and white instead of the standard red/black? I can't figure it out...
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

psyrob wrote:Great screen!! Hey, where in your code does it make the relay box be blue and white instead of the standard red/black? I can't figure it out...
depends on how you want to do it. the values are stored in reefangel_globals.h or you can enable the colors file.

curt
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

Like binder said - I edited the colors through globals.h
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

use caution with editing the globals.h file, that file gets updated with new releases of the libraries. the recommended way is to use the colors file.

curt
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

hmmm yea i forgot that - come to think of it now that I went and looked at it, I did use colors. But I found out what colors were available/preprogrammed by looking at globals.h
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

Deckoz2302 wrote:hmmm yea i forgot that - come to think of it now that I went and looked at it, I did use colors. But I found out what colors were available/preprogrammed by looking at globals.h
ReefAngel_Colors.h contains a list of the colors in it's own file (same as Globals.h, there's a reason why it's like this).
ReefAngel_CustomColors.h is the file that you can make your changes to.

If using those files, they must be included into your PDE file and also the Features.h file needs to have the #define CUSTOM_COLORS in it.

curt
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

I changed it up a little bit - Where moon cycle is in the last picture -

At night it shows moon phase with pwm% and where moonphase is(crescent, quarter, gibb, full ect)
During the day it shows 4 PWM module %'s
If there is a cloud it will show time and duration, also if there is lightning it will change the label from cloud to storm

Code: Select all

 //*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  Wire.requestFrom(8,8);
  for (int a=0;a<12;a++)
  {
    if (Wire.available()) SeasonsVar[a]=Wire.receive();
  }

  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(COLOR_TOMATO,255, 6, 90, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
  for (byte Left=93; Left < 133; Left+=10)
  {
    ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, Left, "|");
    ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, Left, "|");
  }

  ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  ReefAngel.LCD.Clear(255, 1, 19, 128, 29);
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,21,"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.Temp3, 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, 10);
  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.Temp1, COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_CORNFLOWERBLUE, 99, 68, 10);

  if (ReefAngel.PWM.GetActinicValue() > 0)//if moon phase is active display state and pwm %
  {
    ReefAngel.LCD.DrawText(0,255,8,98,"Moon");
    DayAge = MoonAge(day(), month(), year());
    MoonState(DayAge);
    char* ThisPhaseLabel[]={
      "New","Waxing Crescent","First Quarter","Waxing Gibbous","Full","Waning Gibbous","Last Quarter","Waning Crescent"                        };
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,98,ThisPhaseLabel[ThisPhase]);
    ReefAngel.LCD.DrawText(0,255,75,109,"%");
    ReefAngel.LCD.DrawSingleMonitor(COLOR_CORNFLOWERBLUE,255, 60, 109, ReefAngel.PWM.GetActinicValue());
  }
  else if (SeasonsVar[5] > 0) //or if there is a cloud display clouds instead
  {
    if (SeasonsVar[8] > 0) ReefAngel.LCD.DrawText(0,255, 8, 98, "Storm"); //decide between dislaying storm or cloud based on lightningchance
    else ReefAngel.LCD.DrawText(0,255,8,98,"Cloud");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,42,98, SeasonsVar[5]); 
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,54,98, ":");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,59,98, SeasonsVar[6]); 
    ReefAngel.LCD.DrawText(0,255,75,98,"Length");  
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,115,98, SeasonsVar[7]); 
  }
  else //if no moon or clouds show LED PWM %'s
  {
    ReefAngel.LCD.DrawText(0,255,8,98,"W");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,98,SeasonsVar[0]);
    ReefAngel.LCD.DrawText(COLOR_TOMATO,255,33,98,"|");
    ReefAngel.LCD.DrawText(0,255,38,98,"R");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,45,98,SeasonsVar[9]);
    ReefAngel.LCD.DrawText(COLOR_TOMATO,255,63,98,"|");
    ReefAngel.LCD.DrawText(0,255,68,98,"B");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,75,98,SeasonsVar[10]);
    ReefAngel.LCD.DrawText(COLOR_TOMATO,255,93,98,"|");
    ReefAngel.LCD.DrawText(0,255,98,98,"V");
    ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,105,98,SeasonsVar[11]);
   } 

  ReefAngel.LCD.DrawText(0,255,8,109, "Sunrise");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,119, SeasonsVar[1]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,20,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,25,119, SeasonsVar[2]);

  ReefAngel.LCD.DrawText(0,255,88,109, "Sunset");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,90,119, SeasonsVar[3]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,102,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,107,119, SeasonsVar[4]); 
}
void DrawCustomGraph()
{
}
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

Re: Custom Main Screens

Post by psyrob »

Here is my new one....Thanks to the user who posted the wave maker timer code...I'm sure I will be tinkering and making a new screen before too long :)
Attachments
photo (2).jpg
photo (2).jpg (88.87 KiB) Viewed 12918 times
Image
SuperDodge
Posts: 52
Joined: Sun Feb 12, 2012 11:16 am

Re: Custom Main Screens

Post by SuperDodge »

Image

Here's where my screen seems to have settled at during my first week of tinkering with my Reef Angel.

The line that says "Lagoon" will eventually update with my Vortech status (when I save some coin for the RF adapter. The line is always centered

The line that says "Clear Skies" will update to say "Cloudy(XX:XX)" or "Storms(XX:XX)" if there is a cloud or a cloud with lightning coming. This line is always centered.

The moon status updates throughout the month and is always centered.

The line that says W:100% B:100% R:100% updates in real-time to reflect all three channels on my AI Nano fixture. The line is always centered as the position of the numbers changes depending on the number of digits.

THANKS TO EVERYONE WHO PROVIDED GREAT CODE AND IDEAS THROUGHOUT THIS THREAD!

CODE REMOVED BECAUSE I FOUND AN ERROR - WILL REPOST WHEN FIXED
Last edited by SuperDodge on Mon Feb 20, 2012 7:34 am, edited 1 time in total.
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

That's a pretty slick screen SuperDodge!! Nice work. :)
Deckoz2302
Posts: 149
Joined: Tue Nov 01, 2011 11:05 am

Re: Custom Main Screens

Post by Deckoz2302 »

Yes nice screen sir ;)
User avatar
JNieuwenhuizen
Posts: 96
Joined: Thu Feb 16, 2012 12:39 am
Location: South Africa

Re: Custom Main Screens

Post by JNieuwenhuizen »

I love the screen Deckoz2302 made. What bit do i have to edit to change the temp from f to c ?
Also the PWM control bit - I run a vertex illumina unit and that does the cycles by it self.
tkeracer619
Posts: 159
Joined: Thu Nov 24, 2011 9:50 pm
Location: Golden, CO

Re: Custom Main Screens

Post by tkeracer619 »

Is there any way to test the display code without uploading to the controller?
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

tkeracer619 wrote:Is there any way to test the display code without uploading to the controller?
Unfortunately, No. There isn't a way to test the code without running it on the controller.....at least not yet. That's not saying that something is close. It's just saying that the idea has been discussed just nothing has been done for it.
tkeracer619
Posts: 159
Joined: Thu Nov 24, 2011 9:50 pm
Location: Golden, CO

Re: Custom Main Screens

Post by tkeracer619 »

I spend a lot of time in hotels and was thinking it would be something fun to do in my boring hotel room. No biggie. I figured there wasn't. Thanks for the reply.

It would be pretty cool if RAGen had a click, drag, place, and modify type screen maker and would generate the code for you based on the screen you come up with.
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

tkeracer619 wrote:I spend a lot of time in hotels and was thinking it would be something fun to do in my boring hotel room. No biggie. I figured there wasn't. Thanks for the reply.

It would be pretty cool if RAGen had a click, drag, place, and modify type screen maker and would generate the code for you based on the screen you come up with.
well, apparently you can read minds. that is what i want to have it do, however i just have not had time to work on it.
tkeracer619
Posts: 159
Joined: Thu Nov 24, 2011 9:50 pm
Location: Golden, CO

Re: Custom Main Screens

Post by tkeracer619 »

Its scary what you can see with Google maps these days ;)

Sounds awesome.
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Main Screens

Post by binder »

I updated the Guide to be compatible with the latest RAGen and the 0.9.X libraries.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

Deckoz2302 wrote:Image

Code: Select all

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  Wire.requestFrom(8,8);
  for (int a=0;a<8;a++)
  {
    if (Wire.available()) SeasonsVar[a]=Wire.receive();
  }

  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(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.Temp1, 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.Temp3, COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_CORNFLOWERBLUE, 99, 68, 10);

  ReefAngel.LCD.DrawText(0,255,8,97,"Moon");
  DayAge = MoonAge(day(), month(), year());
  MoonState(DayAge);
  if (ThisPhase == 0) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"New");
  else if (ThisPhase == 1) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Crescent");
  else if (ThisPhase == 2) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"First Quarter");
  else if (ThisPhase == 3) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Gibbous");
  else if (ThisPhase == 4) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Full");
  else if (ThisPhase == 5) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Gibbous");
  else if (ThisPhase == 6) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Last Quarter");
  else if (ThisPhase == 7) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Crescent");

  //  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),COLOR_CORNFLOWERBLUE, 105, 109, 1);  

  ReefAngel.LCD.DrawText(0,255,8,109, "Sunrise");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,119, SeasonsVar[1]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,20,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,25,119, SeasonsVar[2]);

  ReefAngel.LCD.DrawText(0,255,75,109,"%");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255, 60, 109, SeasonsVar[0]);

  ReefAngel.LCD.DrawText(0,255,88,109, "Sunset");  
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,90,119, SeasonsVar[3]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,102,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,107,119, SeasonsVar[4]); 
}
void DrawCustomGraph()
{
}
Love this screen...I'm trying to get it to work on mine, but I'm getting a ton of errors...I already have custom main and fonts in my Features.h file???
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

RA_052912_1615custom2Main.cpp: In function 'void DrawCustomMain()':
RA_052912_1615custom2Main:43: error: 'SeasonsVar' was not declared in this scope
RA_052912_1615custom2Main:69: error: 'struct ParamsStruct' has no member named 'Temp1'
RA_052912_1615custom2Main:79: error: 'struct ParamsStruct' has no member named 'Temp1'
RA_052912_1615custom2Main:90: error: 'struct ParamsStruct' has no member named 'Temp3'
RA_052912_1615custom2Main:93: error: 'struct ParamsStruct' has no member named 'Temp2'
RA_052912_1615custom2Main:96: error: 'DayAge' was not declared in this scope
RA_052912_1615custom2Main:96: error: 'MoonAge' was not declared in this scope
RA_052912_1615custom2Main:97: error: 'MoonState' was not declared in this scope
RA_052912_1615custom2Main:98: error: 'ThisPhase' was not declared in this scope
RA_052912_1615custom2Main:110: error: 'SeasonsVar' was not declared in this scope
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom Main Screens

Post by rimai »

Deckoz had a custom code on his Dimming expansion module to calculate sunrise/sunset according to the seasons. Longer days on summer and shorter on winter.
He's got his code in his thread too.
The errors you are getting is related to that.
You can try this:

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()
{
}
To customize a little further, you can read the guide posted here:
http://forum.reefangel.com/viewtopic.php?f=14&t=109
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

ReefAngel\ReefAngel.cpp.o: In function `ReefAngelClass::ProcessButtonPressCustom()':
C:\Users\User\Documents\Arduino\libraries\ReefAngel/ReefAngel.cpp:2047: undefined reference to `MenuEntry1()'
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom Main Screens

Post by rimai »

That error is because you are trying to do custom menu and not custom main screen.
Is it what you wanted?
Can I see the code?
Roberto.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

Got it! Thanks!
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

I'm on my byte size:

How can I shrink this down??

Code: Select all

//The following features are enabled for this File: 
//#define VersionMenu
#define DisplayLEDPWM
#define wifi
//#define WDT
//#define SIMPLE_MENU



#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 <ReefAngel.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>




////// Place global variable code below here
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.DrawLargeText(0,255,8,16,"Redneck Reefin!", Font8x8);
  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.DrawHugeText(COLOR_BLACK, 255, 10, 40, text, Num12x16);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_BLACK, 255, 85, 40, text, Num8x16);
  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,"Light");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_BLACK, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 99, 68, 10);
  ReefAngel.LCD.DrawText(0,255,8,100, "CWLED");  
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,15,119, ReefAngel.PWM.GetDaylightValue());
  //ReefAngel.PWM.GetDaylightValue(), 
  ReefAngel.LCD.DrawText(0,255,88,100, "RBLED");  
  ReefAngel.LCD.DrawText(COLOR_NAVY,255,90,119, ReefAngel.PWM.GetActinicValue());
  //ReefAngel.PWM.GetActinicValue());
  
  //ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
                            //ReefAngel.PWM.GetDaylightValue(), 
                            //ReefAngel.PWM.GetActinicValue());

}
void DrawCustomGraph()
{
}

////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
     ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 860 );
    ReefAngel.SingleATO( true,Port2,60,0 );
    pinMode(lowATOPin,OUTPUT); 
    

    // Ports that are always on
    ReefAngel.Relay.On(Port3);
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);
    ReefAngel.Relay.On(Port5);
    ////// Place additional initialization code below here
    
    //randomSeed(analogRead(0));
    //ReefAngel.Init();  //Initialize controller   
    //ReefAngel.Timer[1].SetInterval(random(15,35));
    //ReefAngel.Timer[1].Start(); 
    //ReefAngel.Relay.On(Port5);


    ////// Place additional initialization code above here
}

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.StandardLights( Port1,19,0,6,30 );
    ReefAngel.StandardHeater( Port4,740,770 );
    ReefAngel.StandardLights( Port7,6,0,20,0 );
    ReefAngel.StandardLights( Port8,7,0,19,0 );
    //////// ReefAngel.Wavemaker1(Port5);
    /////// ReefAngel.Wavemaker2(Port6);
    //ReefAngel.PWM.SetActinic( MoonPhase ) Test for Meanwells
    ReefAngel.PWM.SetDaylight( PWMParabola(7,5,19,0,0,85,0) );
    ReefAngel.PWM.SetActinic( PWMParabola(6,5,21,0,0,85,0) );
   

    ///if ( ReefAngel.Timer[1].IsTriggered() )
         /// {
          ///  ReefAngel.Timer[1].SetInterval(random(15,35));
          ///  ReefAngel.Timer[1].Start();
           /// ReefAngel.Relay.Toggle(Port5);
          ///  ReefAngel.Relay.Toggle(Port6);
          /// }

    
    ////// Place your custom code below here
    
    if (hour()>=6 && hour()<20)
    analogWrite(lowATOPin,0);
    else
    analogWrite(lowATOPin,(int)MoonPhase()*2.55);

    

    ////// Place your custom code above here
    

    // This should always be the last line
    ReefAngel.ShowInterface();
}
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Custom Main Screens

Post by DrewPalmer04 »

I got it to upload. But is there any reason my client suite isn't connecting based on the code above?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
Post Reply