PaulStoffregen / XPT2046_Touchscreen

Touchscreen Arduino Library for XPT2046 Touch Controller Chip
240 stars 84 forks source link

Problem with Lolin TFT 2.4 Touch Shield and Lolin D32 Pro #20

Closed merdok closed 5 years ago

merdok commented 5 years ago

Hi,

I have an issue with the Lolin TFT 2.4 Touch Shield and the Lolin D32 Pro. I am using the tft connector to connect the display to the board and everything works fine except touch. The TFT shield uses the XPT2046 controller. When i configure everything and run the code then the library always reports that a touch is detected, even that i am not touching the screen and the output looks as follows:

Touched!
Pressure = 2445
X = 2972
Y = 2374

All the values (Pressure , X, Y) always change slightly (+-200) even i am not touching the screen. As soon as i touch the screen the output looks like that:

Touched!
Pressure = 3985
X = 1157
Y = 0

No matter where i touch the screen, the Y is always 0 and the X value is always around 1150. The pressure after the initial around 3900 drops then to around 2900 when i hold my finger on the screen. So clearly there is something detected but the values are not correct (at least X and Y).

Could somebody help me fix the problem? Is this a bug with this library or maybe is there something different with the XPT2046 controller on this shield?

mike2nl commented 5 years ago

@merdok Oh wait, i see you used the LoLin D32 Pro. Have you changed the code so far that all GPIO's are 100% correct?

Hi, i have the same 2.4inch TFT display and the TFT and the 2x I2C connectors too.

I used the example code for it and it's working

TFT Adapter:

I have the TFT LED running to and can change the display brightness too.

Self in the original version it was working 100%.

I used the LoLin D1 Mini v3.1.0, From up version 3.1.0 you will find the LoLin logo on the pcb board. It still comes from Wemos. Only the logo is changed because the board got a complete rework which makes it more stable and fixed little things.

I can give you my code for my setup and i can change the code so far that you don't need to add the pot meter for the display brightness.

Contact me here but much better via my github site. E-Mail can be found on the left side.

merdok commented 5 years ago

@mike2nl I guess that all GPIO's are 100% correct. I did not touch anything on the Lolin D32 Pro board and also nothing on the 2.4 Touch TFT shield. Everything is working fine (including brightness change) except that it seems to detect the touches wrong like described in my first post. Any idea what the problem could be?

merdok commented 5 years ago

I ordered another screen and the new one is working correct. So i guess just the touch screen on my previous tft was faulty.

VASKOTechDesign commented 4 years ago

I would like to have a little bit connected question. I have also "Lolin TFT 2.4" and Lolin D32 Pro 2.0.0, Libraries for TFT "ILI9341" adn touch "XPT2046" work fine, I also use TFT connector to connect both devices. I have only 1 issue.

IQR pin is used on TFT display used as signal which has: 3.3V - When not touched 0V - When touched

When I connect board to battery then "IQR" pin on TFT starts sends 3.3V to Board (PIN0 - set as input), then when I press touch screen nothing happen (IQR - still sends 3.3V).

When I connect board to USB to PC then "IQR" pin on TFT starts sends 3.3V to Board (PIN0 - set as input), then when I press touch screen also nothing happen. But when I connect board with REPL (using VS Code and PYMAKR plugin) then display change Voltage on "IQR" pin to "0V" when is touched (as it is supposed to be).

Don´t any one from you know why this happen? Why IQR change voltage only after connecting to REPL? I need to have "IQR" be used right after I start charging Board and TFT.

Thank you

Jan