Earlier this morning I uninstalled Arduino and deleted the libraries, then downloaded arduino and all the libraries but it works just like before.
#include <UTFT.h>
#include <UTouch.h>
#include <UTFT_Buttons.h>
#include <TFT_Extension.h>
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(CTE70CPLD,38,39,40,41);
UTouch myTouch(6, 5, 4, 3, 2);
UTFT_Buttons myButtons(&myGLCD, &myTouch);
TFT_Extension myTFT(&myGLCD, &myTouch);
#define convert(x) {myTFT.ConvertRGB(x)}
#define TOUCH_ORIENTATION 0 //portrait - from calibration file
int panLeftRelay = 8; // Pan Left Touch Button
int panRightRelay = 9;
void setup()
{
pinMode(panLeftRelay, OUTPUT);
pinMode(panRightRelay, OUTPUT);
// setup LCD
myGLCD.InitLCD(0); //portrait
myGLCD.setFont(BigFont);
myGLCD.clrScr();
// Setup Touch Buttons
myTouch.InitTouch(0); //portrait
myTouch.setPrecision(PREC_MEDIUM);
myButtons.setTextFont(BigFont);
//TFT setup commands
myTFT.ExtSetup();
startup();
}
void loop()
{
getButton();
}
void startup()
{
myTFT.SetTouchButtonColors(0, ORANGE, BLUE, FILL, ROUNDED); // (ID number, Pressed Color, Released Color, FILL/NOFILL) Page 1
myTFT.SetTouchButtonColors(1, ORANGE, GREEN, FILL, ROUNDED); // ID number, Pressed Color, Released Color, FILL/NOFILL) Page 2
myTFT.SetTouchButtonText(0, "Page 1", Big, BLUE); // (Text, Font, Color)
myTFT.SetTouchButtonText(1, "Page 2", Big, BLUE); // (Text, Font, Color)
}
void getButton()
{
if (myTFT.TouchButton_Draw(20,20,180,60,0)) //Draw Pan Left Button, ID = 0
{
digitalWrite(panLeftRelay, HIGH); //High when button is pressed
myGLCD.print("Button 0", 60, 200);
}
else
{
digitalWrite(panLeftRelay, LOW); // Low when button is not pressed
}
if (myTFT.TouchButton_Draw(220,20,380,60,1)) //Draw Pan Right Button, ID = 1
{
digitalWrite(panRightRelay, HIGH); // High when button is pressed
myGLCD.print("Button 1", 260, 200);
}
else
{
digitalWrite(panRightRelay, LOW);
}
}
Touchtest.ino (1.84 KB)