I added it manually
This is the way I set the code up
It verifies okay but I get nothing on the screen at all.
Am missing 1 parameter for UTFT myGLCD compared to your code and the way I currently have it set up.
#include <UTouch.h>
#include <avr/pgmspace.h>
#include <UTFT.h>
#include <tinyFAT.h>
#include <UTFT_tinyFAT.h>
#include <EEPROM.h>
#include <RTClib.h>
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <TFT_Extension.h>
#include <math.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
//myGLCD(RS,WR,CS,RST,ALE,mode);
UTFT myGLCD(38,39,40,41,ITDB32S);
//myTouch(TCLK,TCS,DIN,DOUT,IRQ);
UTouch myTouch(6,5,4,3,2);
TFT_Extension myTFT(&myGLCD, &myTouch, LANDSCAPE);
void setup()
{
myGLCD.InitLCD(LANDSCAPE);
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
myTouch.InitTouch(LANDSCAPE);
myTouch.setPrecision(PREC_MEDIUM);
Serial1.begin(115200);
startup();
}
void loop()
{
myTouch.read();
int tx = myTouch.getX();
int ty = myTouch.getY();
int XC= tx > 320? 0 : tx;
int YC= ty > 240? 0 : ty;
//data(XC,YC);
getButton(XC,YC);
}
void startup()
{
myGLCD.setColor(255, 0, 0);//red box fill
myGLCD.fillRect(0, 0, 319, 13);//text box
myGLCD.setColor(255, 255, 255);//text color White
myGLCD.setBackColor(255, 0, 0);//background of text red
myGLCD.drawLine(0, 14, 319, 14);
myGLCD.print("LatchButtons", CENTER, 1);
myGLCD.setBackColor(0, 0, 0);
myGLCD.print("Touch screen to start", CENTER, 119);
myGLCD.clrScr();
makeButton();
}
void getButton(int tx, int ty){
myGLCD.setColor(0,0,0);
boolean me = myTFT.LatchCircle(55,180,50,0,tx,ty); // (x,y,radius, tx,ty)
boolean me2 = myTFT.LatchCircle(265,55,50,1); // (x,y,radius, tx,ty)
boolean button = myTFT.LatchButton(10,10,100,100,0,tx,ty);
boolean button2 = myTFT.LatchButton(220,135,310,225,1);
myGLCD.setBackColor(255, 255, 255);
myGLCD.printNumI(me, 52,176);// circle button 1
myGLCD.setBackColor(255, 0, 0);
myGLCD.printNumI(me2, 263,51); // circle button2
myGLCD.setBackColor(0, 255, 0);
myGLCD.printNumI(button, 50,50);// rect button 1
myGLCD.setBackColor(0, 0, 255);
myGLCD.printNumI(button2, 260,175);// rect button 2
}
void makeButton()
{
myGLCD.setColor(255,255,255);
myGLCD.drawCircle(55,180,50);// circle button 1
myGLCD.setColor(255,0,0);
myGLCD.fillCircle(265,55,50);// circle button 2
myGLCD.setColor(0,255,0);
myGLCD.drawRect(10,10,100,100);// rect button 1
myGLCD.setColor(0,0,255);
myGLCD.fillRect(220,135,310,225);// rect button 2
}
void data(int X, int Y)
{
myGLCD.setBackColor(200, 0, 200);//background of text purple
myGLCD.setColor(255,255,255);
myGLCD.print("X: ", 100,115, 0);
if(Y < 100){
myGLCD.print(" ", 129,115, 0);
myGLCD.printNumI(X, 124, 115);
}
else myGLCD.printNumI(X, 124, 115);
myGLCD.print("Y: ", 180,115,0);
if(X < 100){
myGLCD.print(" ", 209,115, 0);
myGLCD.printNumI(Y, 204, 115);
}
else myGLCD.printNumI(Y, 204, 115);
}