i added used the following the code, however nothing shows on the serial after the lcd is initialized.
// UTFT_SdRaw_800x480_Demo
// Copyright (C)2015 Graham Lawrence (GHLawrence2000). All Rights reserved.
// web: https://github.com/ghlawrence2000/UTFT_SdRaw
//
// This program is a demo of how to use the functions provided by UTFT_SdRaw.
//
// This program requires the UTFT, UTouch, UTFT_Buttons and SdFat libraries.
//
#include <SPI.h>
// SdFat lib from here :-
// https://github.com/greiman/SdFat/archive/master.zip
#include <SdFat.h>
#include <UTFT.h>
#include <UTouch.h>
#include <UTFT_Buttons.h>
#include <UTFT_SdRaw.h>
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
#define SD_CHIP_SELECT 53 // SD chip select pin
// file system object
SdFat sd;
// print stream
ArduinoOutStream cout(Serial);
int wait = 2, pressed_button;
// Initialize display
// ------------------
// Set the pins to the correct ones for your development board
// -----------------------------------------------------------
// Standard Arduino Uno/2009 Shield : <display model>,19,18,17,16
// Standard Arduino Mega/Due shield : <display model>,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Due : <display model>,25,26,27,28
// Teensy 3.x TFT Test Board : <display model>,23,22, 3, 4
// ElecHouse TFT LCD/SD Shield for Arduino Due : <display model>,22,23,31,33
//
// Remember to change the model parameter to suit your display module!
UTFT myGLCD(CTE70, 38, 39, 40, 41);
//UTFT myGLCD(CTE50, 38, 39, 40, 41);
//UTFT myGLCD(CTE70, 38, 39, 40, 41);
// Initialize touchscreen
// ----------------------
// Set the pins to the correct ones for your development board
// -----------------------------------------------------------
// Standard Arduino Uno/2009 Shield : 15,10,14, 9, 8
// Standard Arduino Mega/Due shield : 6, 5, 4, 3, 2
// CTE TFT LCD/SD Shield for Arduino Due : 6, 5, 4, 3, 2
// CTE TFT LCD/SD Shield for Arduino Due (JP10): 6, 5,32, 3, 2
// Teensy 3.x TFT Test Board : 26,31,27,28,29
// ElecHouse TFT LCD/SD Shield for Arduino Due : 25,26,27,29,30
//
UTouch myTouch( 6, 5, 4, 3, 2);
UTFT_SdRaw myFiles(&myGLCD);
UTFT_Buttons myButtons(&myGLCD, &myTouch);
int x,y;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for DUE & Leonardo only
}
Serial.println(F("Initialising SD card..."));
bool mysd = 0;
// see if the card is present and can be initialized:
while (!mysd)
{
if (!sd.begin(SD_CHIP_SELECT, SPI_FULL_SPEED)) {
Serial.println(F("Card failed, or not present"));
Serial.println(F("Retrying...."));
}
else
{
mysd = 1;
Serial.println(F("Card initialised."));
}
}
Serial.println(F("Initialising LCD."));
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);
myButtons.setTextFont(BigFont);
int butskip = myButtons.addButton( 85, 219 , 70, 20, "Skip");
Serial.println(F("LCD initialised."));
myGLCD.clrScr();
myFiles.load(0, 0, 800, 480, "lcd_2.raw", 2, 0);
if (myTouch.dataAvailable()) {
myTouch.read();
x = myTouch.getX();
y = myTouch.getY();
if ((x > 19 && x < 155) && (y > 44 && y < 436)) {
//button 'back'
Serial.println(F("back."));
}
if ((x > 201 && x < 455) && (y > 21 && y < 212)) {
//button 'news'
Serial.println(F("news."));
}
if ((x > 201 && x < 455) && (y > 267 && y < 444)) {
//button 'medicine';
Serial.println(F("medicine."));
}
if ((x > 507 && x < 771) && (y > 26 && y < 208)) {
//button 'light';
Serial.println(F("light."));
}
if ((x > 507 && x < 771) && (y > 263 && y < 448)) {
//button 'towel';
cout << F("Skip button detected (No GPS :( )\n");
}
}
}
void loop()
{
}