Go Down

Topic: 2.4 inch LCD TFT Display Shield only shows white! (Read 44829 times) previous topic - next topic

Ludvig

Yesterday when I arrived home, I remember I had another Arduino Uno in a sort of lego rover I once manage to make. So I decided to give it a try...

To my surprise, it did work! Now it is detecting it as 0x9325 and all the tests run flawlessly. Even if I set it as 0x9328 it works (haven't tried all the features yet).

I'm a bit embarrased to find out that the problem was in my board (that I have used for several tests and projects, it's now a matter of finding out what is wrong with it) but I hope my experience and info helps someone else.

Let me know if I can provide more info, for the records and thanks specially to david for your help!

david_prentice

The Arduino MUST have a good 3.3V pin for these Shields.

Most sketches and shields never use the 3.3V pin.

David.

pauldusa

Try adding these lib.

#include <TFTConsole.h>
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
 
if you are just getting white

my 2.4 address is Ox9325

there is a 0x9341 one too

mind was white until I added in the TFTConsole, at github

pauldusa

// Works Fine as a test

// Uno & 2.4 TFT Lcd Adafruit shield

// Change Address in setup for your shield

#include <TFTConsole.h>
#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>   
//#include <TouchScreen.h>


#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#define TS_MINX 204
#define TS_MINY 195
#define TS_MAXX 948
#define TS_MAXY 910

#define YP A2  // must be an analog pin, use "An" notation!
#define XM A3  // must be an analog pin, use "An" notation!
#define YM 8   // can be a digital pin
#define XP 9   // can be a digital pin

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
//TouchScreen ts = TouchScreen(XP, YP, XM, YM, 200);

void setup() {
  Serial.begin(9600);
  Serial.print("Starting...");

   tft.reset();


// --------- Change Below for your Board's Address ----------
 
   tft.begin(0x9325);
 
 //tft.begin(0x9341);
 
 // ect.

//--------------------------------------------------------------

 
  tft.setRotation(1);

 tft.fillScreen(BLACK);

  //Print "PPM CO" Text
  tft.setCursor(80,30);
  tft.setTextColor(RED);
  tft.setTextSize(5);
  tft.print("Hello");

  delay(1000);
}

void loop() {
 
 
  tft.setCursor(40,100);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.print("No more white screen");

    tft.setCursor(40,150);
  tft.setTextColor(BLUE);
  tft.setTextSize(5);
  tft.print("Have Fun");

}

moeburn

#124
Jun 24, 2017, 11:21 pm Last Edit: Jun 25, 2017, 12:02 am by moeburn
Hello folks, I have a similar 2.4" TFT, but mine has the R1/R2 jumpers like some others have mentioned:

http://i.imgur.com/spZqPN8.jpg

I have managed to get all the graphics demos working, I just can't get any response from the touchscreen demos.  I bought it from these guys:

https://www.creatroninc.com/product/24-tft-lcd-touch-shield/

But it's just ever so slightly different from the picture they have on their website.  Have I been duped, does this particular one not do touchscreen?

EDIT:  Nevermind I've got it all figured out.  If you have the 2.4" TFT shield like mine with the R1 and R2 resistor jumpers on the bottom, use this guy's library:

https://github.com/JoaoLopesF/SPFD5408

The graphics should work.  To get the touchscreen working, in TFTpaint change the 4 #define YP etc lines to these pins:

Code: [Select]
#define YP A3  // must be an analog pin, use "An" notation!
#define XM A2  // must be an analog pin, use "An" notation!
#define YM 9   // can be a digital pin
#define XP 8   // can be a digital pin


That'll get the touchscreen working, to get the inversion correct open up SPFD5408_TouchScreen.cpp and change "//return TSPoint(x, 1023 - y, z);" to this:

Code: [Select]
return TSPoint(1023 - x, 1023 - y, z);

Hope this helps any future googlers

mirycia

hi goltermc good function


i change the parameters

 if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
    Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    Serial.println(F("Also if using the breakout, double-check that all wiring"));
    Serial.println(F("matches the tutorial."));
    //return;
    identifier = 0x9341;
  }


vey nice thanks


isaquearddev

Your display is fake, not original.
Download this library for fake display : https://github.com/JoaoLopesF/SPFD5408

Go Up