ok so i am trying to make a code that will fit on all the tft lcd screens which are the 3.2" tft and the 7" tft screens....
for the 5" the resolution is the same as the 7" so i didnt mention it...
does anyone know how i can make this happen?
i currently have the size on a 3.2" tft screen but i wanted to make it workable on all the screens by enlarging the size to fit the 7" lcd screen...
this code here is for a 3.2" tft lcd that i want to be able to work with both the 3.2" and the 7" when changing a line under "//Change for Correct TFT LCD screen"
#include <UTFT.h> // used to interface with the TFT display
//LCD TOUCH PANEL and ITDB02 MEGA SHIELD v1.1
//(Mega Shield utilizes pins 5V, 3V3, GND, 2-6, 20-41, & (50-53 for SD Card))
UTFT myGLCD(SSD1289,38,39,40,41); //Uncomment this line for the 3.2" TFT Screen
//UTFT myGLCD(CTE70,38,39,40,41); //Uncomment this line for the 7" TFT Screen
//Change for Correct TFT LCD screen
int x2 = ; // make this work for 7" TFT screen
int y2 = ; // make this work for 7" TFT screen
/*********************** MAIN SCREEN ********** dispScreen = 0 ************************/
void mainScreen()
{
myGLCD.setColor(56, 142, 142); //Draw Borders & Dividers Color
myGLCD.drawRect(0, 0, 319, 239); //Outside Border
/*************************************** HEADER BOARDERS ******************************************/
myGLCD.fillRect(1, 15, 318, 17); //Bottom Header Divider
myGLCD.fillRect(1, 47, 318, 50); //Bottom Status indicator icon Divider
myGLCD.drawRect(1, 18, 2, 46); //Left Status indicator icon Divider
myGLCD.drawRect(317, 18, 318, 46); //Right Status indicator icon Divider
/*************************************** HARDWARE COOLING BOARDERS ******************************************/
myGLCD.drawRect(0, 68, 150, 70); //"Hardware cooling" bottom Horizontal Divider
myGLCD.drawRect(0, 125, 150, 127); //Horizontal Bottom Hardware Cooling Status Divider
/*************************************** Center Split BOARDER ******************************************/
myGLCD.drawRect(150, 15, 152, 127); //Vertical Center Divider
/*************************************** TEMPERATURE MONITORS BOARDER ******************************************/
myGLCD.drawRect(152, 68, 319, 70); //"Temperature Monitors" bottom Horizontal Divider
myGLCD.drawRect(156, 92, 315, 94); //Horizontal Top Temperature Status Divider
myGLCD.drawRect(205, 88, 207, 125); //Vertical Temperature Divider #1
myGLCD.drawRect(265, 88, 267, 125); //Vertical Temperature Divider #2
myGLCD.drawRect(152, 125, 319, 127); //Horizontal Bottom Temperature Divider
/*************************************** TIME/DATE BOARDERS ******************************************/
myGLCD.drawRect(0, 224, 319, 226); //Top Time/Date Divider
myGLCD.drawRect(133, 127, 135, 224); //Left Vertical "Dosage left" Divider
myGLCD.drawRect(228, 127, 230, 180); //Left Vertical Humidity Divider
myGLCD.drawRect(228, 180, 319, 182); //Settings icon top Horizontal Divider
myGLCD.drawRect(228, 182, 230, 224); //Left Settings icon Vertical Divider
myGLCD.setColor(64, 64, 64);
myGLCD.fillRect(1, 1, 318, 14); //Hearer Bar rect filled - Gray
}
/******************************** END OF MAIN SCREEN **********************************/
/*********************** Settings SCREEN ********** dispScreen = 1 ************************/
void setup()
{
Serial.begin(9600);
myGLCD.InitLCD(LANDSCAPE);
myGLCD.clrScr();
mainScreen();
}
void loop()
{
mainScreen();
}