Custom Main screen

Would you like to help?
Share your walkthrough tutorial with others

Posts: 29
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding
PostPosted: Wed Oct 10, 2012 2:30 pm
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()
{
}

Posts: 12225
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Oct 10, 2012 3:02 pm
You don't want to show or you do want to show?
Roberto.

Posts: 29
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding
PostPosted: Wed Oct 10, 2012 4:41 pm
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.

Posts: 12225
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Wed Oct 10, 2012 4:55 pm
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.

Posts: 327
Joined: Tue Mar 22, 2011 12:45 am
Location: San Diego, CA
PostPosted: Wed Oct 10, 2012 6:42 pm
two threads titled custom main screen(s) in tutorials.. uh ohhhh

Posts: 29
Joined: Thu Sep 27, 2012 11:02 pm
Location: Redding
PostPosted: Wed Oct 10, 2012 9:55 pm
Thanks Roberto, you are awesome.

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests