Problems With My Stupid TFT!

My stupid TFT Touch shield won't work... Please help me!!!!

This is the shield: http://www.amazon.com/Touch-Screen-Socket-Arduino-Module/dp/B00UAA2XIC/ref=sr_1_1?ie=UTF8&qid=1459026927&sr=8-1&keywords=arduino+tft

And this is my code:

#include "TouchScreen.h"
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

// Pins for the LCD Shield
#define YP A3 // must be analog
#define XM A2 // must be analog
#define YM 9  // digital or analog pin
#define XP 8  // digital or analog pin

#define MINPRESSURE 1
#define MAXPRESSURE 1000

// Calibration mins and max for raw data when touching edges of screen
#define TS_MINX 210
#define TS_MINY 210
#define TS_MAXX 915
#define TS_MAXY 910


// Assign human-readable names to some common 16-bit color values:
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

const char* touchMeStr = "Touch Me / Press Button";

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);

TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);

int touchCnt = 0;
int buttonState = 0;
long int timeCnt;
char drawChars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
const int SCREEN_TIMEOUT = 10000;


void setup() {
  // put your setup code here, to run once:

  tft.reset();

  uint16_t identifier = tft.readID();

  tft.begin(identifier);

  tft.fillScreen(BLACK);
  tft.setRotation(1);
  tft.setCursor(30,100);
  tft.setTextColor(RED); 
  tft.setTextSize(2);
  tft.println("LCD driver chip: ");
  tft.setCursor(100, 150);
  tft.setTextColor(BLUE);
  tft.println(identifier, HEX);

  delay(3000);

  tft.fillScreen(BLACK);
  tft.setTextColor(YELLOW);

 tft.setCursor(0, 0);
 tft.println(touchMeStr);

 timeCnt = millis();
}


void loop() {
  // put your main code here, to run repeatedly:

  // a point object holds x y and z coordinates
  TSPoint p = ts.getPoint();

  pinMode(XM, OUTPUT);
  pinMode(YP, OUTPUT);

  if (millis() > (timeCnt + SCREEN_TIMEOUT))
  {
    RunScreenSaver();
  } else {
    drawButtons();
  }

  // we have some minimum pressure we consider 'valid'
  // pressure of 0 means no pressing
  if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
    // reset the screen
    tft.fillScreen(BLACK);
    tft.setCursor(0, 0);
    tft.setTextSize(2);
    tft.println(touchMeStr);

    long colorPressure = (p.z * 65535) / 1000; //color changes dependent on pressure

    colorPressure = YELLOW; // just to make it easier to see when testing

    if (touchCnt == 10)
    {
      touchCnt = 0;
    }

    // May need to adjust if cordinates are being reversed due to screen rotation
    int YY = tft.height() - (map(p.x, TS_MINX, TS_MAXX, 0, tft.height()));
    int XX = tft.width() - (map(p.y, TS_MINY, TS_MAXY, 0, tft.width()));

    // determine if a button has been pressed
    if (XX > 295 && YY < 30) // first button region 30 up
      buttonState = 0;
    if ((XX >= 295 && YY >=30) && (XX >= 295 && YY < 60)) // second button region 30 thru 59
      buttonState = 1;
    if ((XX >= 295 && YY >=60) && (XX >= 295 && YY < 100)) // second button region 60 thru 99
      buttonState = 2;
    if ((XX > 295 && YY >=100) && (XX >= 295 && YY < 120)) // second button region 100 thru 119
      buttonState = 3;
    if ((XX > 295 && YY >= 120) && (XX >= 295 && YY < 155)) // second button region 120 thru 154
      buttonState = 4;
    if ((XX >= 295 && YY >= 155) && (XX >= 295 && YY < 200)) // second button region 155 thru 200
      buttonState = 5;

    // button pressed
    switch (buttonState)
    {
      case 0:
        tft.fillCircle(305, 20, 10, RED);
        tft.drawCircle(305, 20, 10, GREEN);
        tft.drawCircle(XX, YY, p.z / 10, colorPressure);
        break;

      case 1:
        tft.fillTriangle(295, 60, 305, 40, 315, 60, RED);
        tft.drawTriangle(XX, YY, XX + 50, YY + 50, YY - 50, XX - 50, colorPressure);
        break;

      case 2:
        tft.fillRect(295, 75, 20, 15, RED);
        tft.drawRect(XX, YY, 100, 50, colorPressure);
        break;

      case 3:
        tft.drawCircle(308, 110, 10, RED);
        tft.drawCircle(299, 110, 10, RED);
        DrawDesign(XX, YY, 3, 25);
        break;

      case 4:
        tft.drawTriangle(295, 155, 305, 125, 315, 140, RED);
        tft.drawTriangle(300, 155, 310, 125, 320, 140, RED);
        TriangleDesign(XX, YY, 5);
        break;

      case 5:
        tft.drawChar(295, 160, 'a', RED, RED, 3);
        tft.drawChar(XX, YY, drawChars[touchCnt], colorPressure, colorPressure, 6);
        break;
    }

    // Prints out the raw and transposed data which is useful for troubleshooting

    tft.setTextSize(1);
    tft.setTextColor(colorPressure); // converts the pressure reading to a color

    tft.print("Raw X = ");
    tft.print(p.x);

    tft.print(" RAW Y = ");
    tft.println(p.y);

    tft.print(" Pressure = ");
    tft.println(p.z);

    tft.print("ScreenX: ");
    tft.println(XX);
    tft.print("ScreenY: ");
    tft.println(YY);

    tft.print("LCD Driver: ");
    tft.println(tft.readID(), HEX);

    touchCnt = touchCnt + 1;
    timeCnt = millis();   
    }
    
}

void drawButtons()
{
  // Setup Buttons
  // circle button unpressed
  if (buttonState == 0)
    tft.fillCircle(305, 20, 10, RED);
  else
    tft.fillCircle(305, 20, 10, GREEN);

  // triangle button
  if (buttonState == 1)
  {
    tft.fillTriangle(295, 60, 305, 40, 315, 60, RED);
  } else {
    tft.fillTriangle(295, 60, 305, 40, 315, 60, GREEN);
  }

  // rectangle button
  if (buttonState == 2)
  {
    tft.fillRect(295, 75, 20, 15, RED);
  } else {
    tft.fillRect(295, 75, 20, 15, GREEN);
  }

  // circle button
  if (buttonState == 3)
  {
    tft.drawCircle(308, 110, 10, RED);
    tft.drawCircle(299, 110, 10, RED);
  } else {
    tft.drawCircle(308, 110, 10, GREEN);
    tft.drawCircle(299, 110, 10, GREEN);
  }

  // triangle button
  if (buttonState == 4)
  {
    tft.drawTriangle(295, 155, 305, 125, 315, 140, RED);
    tft.drawTriangle(300, 155, 310, 125, 320, 140, RED);
  } else {
    tft.drawTriangle(295, 155, 305, 125, 315, 140, GREEN);
    tft.drawTriangle(300, 155, 310, 125, 320, 140, GREEN);
  }

  // character draw button
  if (buttonState == 5)
    tft.drawChar(295, 160, 'a', RED, RED, 3);
  else
    tft.drawChar(295, 160, 'a', GREEN, GREEN, 3);
}

  
void RunScreenSaver()
{
  randomSeed(millis() / 100);

  int x = random(20, 300);
  int y = random(20, 220);

  tft.fillScreen(BLACK);
  tft.setCursor(x - 50, y + 50);
  //tft.setTextSize(x / 100);
  tft.setTextSize(1);
  tft.print("myTFT Screen Saver");
  delay(1000);

}

void TriangleDesign(int XX, int YY, int mp)
{
  for (int i=0; i<5; i++)
  {
    tft.drawTriangle(XX, YY, XX + (mp * i), YY + (mp * i), YY - (mp * i), XX - (mp * i), RED);
  }
}

void DrawDesign(int XX, int YY, int mp, int rad)
{
  for (int i=0; i<5; i++)
  {
    tft.drawCircle(XX + (i * mp), YY - (i * mp), rad, RED);
    tft.drawCircle(XX + (i * mp), YY - (i * mp), rad, GREEN);
    tft.drawCircle(XX + (i * mp), YY - (i * mp), rad, BLUE);
    tft.drawCircle(XX + (i * mp), YY - (i * mp), rad, YELLOW);
  }
}

void CircleMove(int speed)
{
  for (int i = 0; i <320; i++)
  {
    tft.drawCircle(i + speed, 120, 30, WHITE);
    tft.fillScreen(BLACK);
  }
}

The shield is plugged into the Arduino like this

When I run the sketch, the TFT lights up. But it only displays a blank, white screen. This white screen does nothing.

Please tell me how I can fix this. What is the problem? Any help is always loved!

What is the problem?

Clearly, the problem is that your TFT doesn't appreciate being called stupid.

No, wait, the problem is that you use the useless phrase "doesn't work". You posted some code that someone claims works with some TFT. You provided no proof that the claim is that it works with your TFT.

The code does something. You didn't describe that it actually does.

You expect it to do something, but again failed to say what you expect.

PaulS:
Clearly, the problem is that your TFT doesn't appreciate being called stupid.

No, wait, the problem is that you use the useless phrase "doesn't work". You posted some code that someone claims works with some TFT. You provided no proof that the claim is that it works with your TFT.

The code does something. You didn't describe that it actually does.

You expect it to do something, but again failed to say what you expect.

All I'm asking is that my TFT does something other than off, or blank white.

Hello? The problem is still occurring. Any helpful code / suggestions

WesleyRTech:
My stupid TFT Touch shield won't work... Please help me!!!!

This is the shield: http://www.amazon.com/Touch-Screen-Socket-Arduino-Module/dp/B00UAA2XIC/ref=sr_1_1?ie=UTF8&qid=1459026927&sr=8-1&keywords=arduino+tft

And this is my code:

When I run the sketch, the TFT lights up. But it only displays a blank, white screen. This white screen does nothing.

Please tell me how I can fix this. What is the problem? Any help is always loved!

Want to hire a computer technician?
Buy professional computer technician services directly on Amazon. Backed by our Happiness Guarantee.

They guarantee to make you happy. You do want to be happy, yes?

Does the display have a contrast pot that needs adjusting?

If not maybe the discussion here can help:-
TFT discussion.

Calling an inanimate object stupid reflects badly on you.

G

It works with the following library:
http://forum.arduino.cc/index.php?topic=292777.0

Download "MCUFried TFT Display UNO y MEGA libraries.zip"
Inside are four libraries. Copy them to your arduino libraries folder.

backwoodsjack:
It works with the following library:
www.mcufriend.com working in arduino uno and arduino mega - Displays - Arduino Forum

Download "MCUFried TFT Display UNO y MEGA libraries.zip"
Inside are four libraries. Copy them to your arduino libraries folder.

Ok. I will try it and get back to you all.

backwoodsjack:
It works with the following library:
www.mcufriend.com working in arduino uno and arduino mega - Displays - Arduino Forum

Download "MCUFried TFT Display UNO y MEGA libraries.zip"
Inside are four libraries. Copy them to your arduino libraries folder.

Just to be clear, What sketch do I load once I install all 4 libraries. Do I use the same code but with those libraries? What code do I use with all four libraries included?

i didnt download it but there are usually a folder with example sketches..
or just try ur sketch with the new library files..

This is a common problem to many. First, before you buy from Amazon or eBay, ask the vendor: "Which Arduino library was used to test this display?" If they don't give you an answer, look for another vendor or display. And second, almost every library has an Examples folder, and that's where you should immediately turn for help on getting the display up and running.

backwoodsjack:
i didnt download it but there are usually a folder with example sketches..
or just try ur sketch with the new library files..

But what EXAMPLE Sketch should I use? From wich of the 4 libraries? Any one but with the other libraries included??

WesleyRTech:
But what EXAMPLE Sketch should I use? From wich of the 4 libraries? Any one but with the other libraries included??

Try each one and find the one that works.

Yes Wes, experiment. Start with all four .h files included. That's how most of those multi-packages packages work.

None of it is WORKING! I need this by tomorrow!!! Can someone PLEASE provide some code?

Ok. So I went back to the Amazon.com page I got the TFT from. A person in the Q&A had already asked a similar question, and one of the people said to go here: Adafruit GFX library | Adafruit 2.8" TFT Touch Shield v2 - Capacitive or Resistive | Adafruit Learning System

I went there (The Ada fruit Learning System) I got their library, and tried to run the "graphicstest" code. However, when I attempted upload, I got an error. I have never encountered that error before! What to do? The error is:

Arduino: 1.6.9 Hourly Build 2016/03/25 03:03 (Mac OS X), Board: "Arduino/Genuino Uno"

Sketch uses 19,534 bytes (60%) of program storage space. Maximum is 32,256 bytes.
Global variables use 600 bytes (29%) of dynamic memory, leaving 1,448 bytes for local variables. Maximum is 2,048 bytes.

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x10
avrdude: stk500_cmd(): programmer is out of sync
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

PLEASE HELP ME!!!!

ANYONE???