Now working with touch
when i have time ill fix up the touch part i like the way you done it
#include <SPIflash.h>
#include <UTFT.h>
#include <UTFT_SPIflash.h>
#include <UTouch.h>
UTFT myGLCD(CPLD,25,26,27,28);
UTouch myTouch( 6, 5, 4, 3, 2);
int x, y;
char stCurrent[20]="";
int stCurrentLen=0;
char stLast[20]="";
SPIflash myFlash(52);
UTFT_SPIflash myFiles(&myGLCD, &myFlash);
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
uint8_t fileid;
uint16_t filetype;
int homepage = 0;
//////////////////////////////////////////////////////////////////////////////////////////
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
myTouch.InitTouch();
myGLCD.setColor(255,255,255);
myGLCD.setFont(SmallFont);
myFlash.begin();
if (myFlash.ID_device==0)
{
myGLCD.print("Unknown flash device!", 0, 0);
while (true) {};
}
setup0();
}
//////////////////////////////////////////////////////////////////////////////////////////
void setup0()
{
myGLCD.setWritePage(0);
myGLCD.fillScr(VGA_BLACK);
myGLCD.setColor(VGA_WHITE);
myGLCD.setFont(BigFont);
myGLCD.print("7 TFT TOUCH SCREEN", CENTER, 0);
myGLCD.print("CPLD PAGESWITCHING", CENTER, 16);
myGLCD.print("SPI FLASH W25Q64FV 64Mbit", CENTER, 32);
myGLCD.print("PROCESSOR: SAM3X8E ARM CORTEX-M3 CPU", CENTER, 48);
myGLCD.print("INITIALIIZING PROGRAM", CENTER, 80);
myGLCD.print("LOADING PLEASE WAIT", CENTER, 96);
myGLCD.setDisplayPage(0);
/////////////////////////////////////////////////
myGLCD.setWritePage(1);
myFiles.loadBitmap(0, 0, 0);
myGLCD.setWritePage(2);
myFiles.loadBitmap(1, 0, 0);
myGLCD.setWritePage(3);
myFiles.loadBitmap(2, 0, 0);
myGLCD.setWritePage(4);
myFiles.loadBitmap(3, 0, 0);
myGLCD.setWritePage(5);
myFiles.loadBitmap(4, 0, 0);
myGLCD.setWritePage(6);
myFiles.loadBitmap(5, 0, 0);
myGLCD.setWritePage(7);
myFiles.loadBitmap(6, 0, 0);
}
//////////////////////////////////////////////////////////////////////////////////////////
void loop()
{
if (homepage == 0) {
home();
homepage = 1;
delay(2000);
image1();
myGLCD.setWritePage(0);
myFiles.loadBitmap(7, 0, 0);
}
if (myTouch.dataAvailable())
{
myTouch.read();
x=myTouch.getX();
y=myTouch.getY();
if ((y>=15) && (y<=74)) // HOME
{
if ((x>=582) && (x<=641))
{
//////////////////////////////////////////////////////////////////////
image1();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=15) && (y<=74)) // SETUP
{
if ((x>=654) && (x<=712))
{
//////////////////////////////////////////////////////////////////////
image2();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=15) && (y<=74)) // GRASS
{
if ((x>=725) && (x<=784))
{
//////////////////////////////////////////////////////////////////////
image3();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=189) && (y<=248)) // 1
{
if ((x>=14) && (x<=73))
{
//////////////////////////////////////////////////////////////////////
image4();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=262) && (y<=321)) // 2
{
if ((x>=14) && (x<=73))
{
//////////////////////////////////////////////////////////////////////
image5();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=334) && (y<=393)) // 3
{
if ((x>=14) && (x<=73))
{
//////////////////////////////////////////////////////////////////////
image6();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
if ((y>=406) && (y<=464)) // 4
{
if ((x>=14) && (x<=73))
{
//////////////////////////////////////////////////////////////////////
image7();
delay(500);
//////////////////////////////////////////////////////////////////////
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////
void home()
{
myGLCD.setDisplayPage(1);
}
void image1()
{
myGLCD.setDisplayPage(2);
}
void image2()
{
myGLCD.setDisplayPage(3);
}
void image3()
{
myGLCD.setDisplayPage(4);
}
void image4()
{
myGLCD.setDisplayPage(5);
}
void image5()
{
myGLCD.setDisplayPage(6);
}
void image6()
{
myGLCD.setDisplayPage(7);
}
void image7()
{
myGLCD.setDisplayPage(0);
}
//////////////////////////////////////////////////////////////////////////////////////////
When i have time i will design a new control PCB for this 7" display just as i done with the 3.2"


