ok what have i dun now lol
// UTFT_Demo_320x240
#include <UTFT.h>
#include <ITDB02_Touch.h>
// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
// Uncomment the next line for Arduino Mega
UTFT myGLCD(ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!
ITDB02_Touch myTouch(6,5,4,3,2);
int x, y;
char stCurrent[20]="";
int stCurrentLen=0;
char stLast[20]="";
void setup()
{
// Setup the LCD
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(BigFont);
myTouch.InitTouch(LANDSCAPE);
myTouch.setPrecision(PREC_MEDIUM);
pinMode(13, OUTPUT);
// L,R up, down
myGLCD.print("LIGHTING CONTROL", 25, 300);
myGLCD.print("ON", 54, 385);
myGLCD.print("OFF", 218, 385);
myGLCD.setColor(0, 0, 255);
// T,L B,L T,R B,R
myGLCD.drawRoundRect(50,100,100,170); // Draw a rectangle
myGLCD.drawRoundRect(220,100,270,170); // Draw a rectangle
myGLCD.setColor(0, 300, 255);
}
void loop()
{
if (myTouch.dataAvailable())
{
myTouch.read();
x=myTouch.getX();
y=myTouch.getY();
if ((y>=50) && (y<=100))
{
if ((x>=100) && (x<=170)) // Button: On
{
digitalWrite(13, HIGH); // set the LED on
}
if ((x>=270) && (x<=170)) // Button; Off
{
digitalWrite(13, LOW); // set the LED off
}
}
}
}