Interfacing and Fixing Touch Problem on TFT LCD 2.4″ Shield

Interfacing the shield with Arduino UNO board and fixing the touch detection and inversion problem.

Dec 4, 2018

23467 views

18 respects

Components and supplies

1

Arduino UNO

Project description

Downloadable files

TFT Shield

Well..it's a shield

TFT Shield

Comments

Only logged in users can leave comments

kazike

2 years ago

Hola, excelente! estaba por devolver la compra no encontraba alguna libreria que reconociera el tactil, con su solución puedo comenzar mi proyecto, mis valores son 1063 y 990, gracias por su trabajo. Saludos y felicitaciones!

Anonymous user

2 years ago

Hvorfor ikke snakke på norsk?

Anonymous user

2 years ago

Præcis.... forstår ikke folk ikke overholder spillereglerne for at være på et Engelsk site :D Nå men vi fik da gjort lidt grin med det, selv om de sikkert ikke forstår en dyt af det vi skriver ;O)

Pierrot1610

2 years ago

Merci pour avoir résolu ce problème

Anonymous user

2 years ago

Thank you for a very useful page. I had a similar problem. Display bought on Amazon with a link to a project that did not work. Found one problem in the library and fixed it (the function that was supposed to return the driver chip's ID did not work, I tried the various IDs referenced in the library and found one that worked, 0x9341. Then the keypad did not work. My display is a 2.8" so I replaced tft.begin( identifier ); with tft.begin( 0x9341 ); For the keypad, I checked with an ohmmeter between an analog pin and a digital pin until I read about 360 Ohms. That was XP and XN, the rest was easy. #define YP A2 #define XM A1 #define YM 6 #define XP 7 Bingo! About the screen being flipped, among the different chip IDs I tried, one worked but with a mirrored image. I tried the other IDs and 0x9341 provided a non-flipped image. I did not have to make any change to the library itself. So before trying all sorts of mods in the library, just try the different IDs. Here are those that are referenced in the library: 0x 7575 0x8357 0x9325 0x9328 0x9341 Update: I got two displays from the same vendor. They look the same but the touchpad part number is different, HSD028266 for the one that works with my sample code, and HSD-8985J for the second one which returns completely different coordinates for the same points on the screen... Here is how I modified the retrieveTouch() routine for the two touch panels: // display #1 with touch panel HSD-8985J X = map( p.y, TS_MAXX, TS_MINX, 0, tft.width() ); Y = map( p.x, TS_MAXY, TS_MINY, 0, tft.height() ); // display #2 with touch panel HSD028266 X = tft.width() - map( p.x, TS_MAXX, TS_MINX, 0, tft.width() ); Y = map( p.y, TS_MAXY, TS_MINY, 0, tft.height() );

Anonymous user

4 years ago

Thank you for a very useful page. I had a similar problem. Display bought on Amazon with a link to a project that did not work. Found one problem in the library and fixed it (the function that was supposed to return the driver chip's ID did not work, I tried the various IDs referenced in the library and found one that worked, 0x9341. Then the keypad did not work. My display is a 2.8" so I replaced tft.begin( identifier ); with tft.begin( 0x9341 ); For the keypad, I checked with an ohmmeter between an analog pin and a digital pin until I read about 360 Ohms. That was XP and XN, the rest was easy. #define YP A2 #define XM A1 #define YM 6 #define XP 7 Bingo! About the screen being flipped, among the different chip IDs I tried, one worked but with a mirrored image. I tried the other IDs and 0x9341 provided a non-flipped image. I did not have to make any change to the library itself. So before trying all sorts of mods in the library, just try the different IDs. Here are those that are referenced in the library: 0x 7575 0x8357 0x9325 0x9328 0x9341 Update: I got two displays from the same vendor. They look the same but the touchpad part number is different, HSD028266 for the one that works with my sample code, and HSD-8985J for the second one which returns completely different coordinates for the same points on the screen... Here is how I modified the retrieveTouch() routine for the two touch panels: // display #1 with touch panel HSD-8985J X = map( p.y, TS_MAXX, TS_MINX, 0, tft.width() ); Y = map( p.x, TS_MAXY, TS_MINY, 0, tft.height() ); // display #2 with touch panel HSD028266 X = tft.width() - map( p.x, TS_MAXX, TS_MINX, 0, tft.width() ); Y = map( p.y, TS_MAXY, TS_MINY, 0, tft.height() );

Pierrot1610

6 years ago

Merci pour avoir résolu ce problème

kazike

6 years ago

Hola, excelente! estaba por devolver la compra no encontraba alguna libreria que reconociera el tactil, con su solución puedo comenzar mi proyecto, mis valores son 1063 y 990, gracias por su trabajo. Saludos y felicitaciones!

Anonymous user

2 years ago

Hvorfor ikke bare skrive på Grønlandsk, det er der heller ikke en hat der forstår.

Anonymous user

2 years ago

Præcis.... forstår ikke folk ikke overholder spillereglerne for at være på et Engelsk site :D Nå men vi fik da gjort lidt grin med det, selv om de sikkert ikke forstår en dyt af det vi skriver ;O)

Anonymous user

2 years ago

Hvorfor ikke snakke på norsk?