Custom Main screen

Would you like to help?
Share your walkthrough tutorial with others
Post Reply
stevengreen2
Posts: 28
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding

Custom Main screen

Post by stevengreen2 »

I want to use the custom main screen that was made but I want to pull channel 0 and 1 off of the PWM add on.

Code: Select all

#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>


byte ActinicPWMValue=0;
byte DaylightPWMValue=0;

////// Place global variable code below here
void DrawCustomMain()
{
  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(0,255,3,17,"Drew Palmer's 75 Reef");
  


  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.Clear(255,0,120,132,132);
  ReefAngel.LCD.DrawText(0,255,48,47,"Cloud");
  ReefAngel.LCD.DrawText(0,255,48,57,"00:00");

  ReefAngel.LCD.DrawText(0,255,10,30,"Display");
  ConvertNumToString(text, ReefAngel.Params.Temp[T3_PROBE], 10);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 10, 40, text);
  
  ReefAngel.LCD.DrawText(0,255,8,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Light");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], COLOR_BLACK, 99, 68, 10);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawText(COLOR_BLACK, 255, 95, 40, text);
  
  pingSerial();

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

  pingSerial();
  
  ReefAngel.LCD.DrawText(0,255,8,100, "CWLED");  
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,15,119, ReefAngel.PWM.GetDaylightValue());
  
  ReefAngel.LCD.DrawText(0,255,88,100, "RBLED");  
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,90,119, ReefAngel.PWM.GetActinicValue());
  

}
void DrawCustomGraph()
{
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom Main screen

Post by rimai »

You don't want to show or you do want to show?
Roberto.
stevengreen2
Posts: 28
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding

Re: Custom Main screen

Post by stevengreen2 »

In the code it's pulling the CWLED and RBLED values from the built on dimming circuits. I want to pull channel 0 and 1 from the add on PWM dimming controller instead.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Custom Main screen

Post by rimai »

Use this instead:

Code: Select all

    ReefAngel.LCD.DrawText(0,255,8,100, "CWLED");  
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,15,119, ReefAngel.PWM.GetChannelValue(0));
  
  ReefAngel.LCD.DrawText(0,255,88,100, "RBLED");  
  ReefAngel.LCD.DrawText(COLOR_BLACK,255,90,119, ReefAngel.PWM.GetChannelValue(1));
Roberto.
alexwbush
Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA

Re: Custom Main screen

Post by alexwbush »

two threads titled custom main screen(s) in tutorials.. uh ohhhh
stevengreen2
Posts: 28
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding

Re: Custom Main screen

Post by stevengreen2 »

Thanks Roberto, you are awesome.
Post Reply