ESP32_TFT_library icon indicating copy to clipboard operation
ESP32_TFT_library copied to clipboard

XPT2046 touch calculation

Open nottledim opened this issue 6 years ago • 4 comments

I'm not having much success getting touch to work. There is one show stopper in TFT_read_touch in tft.c.

There is a test for (ybottom - ytop) <= 0 which is always true and so calculation is always abandoned.

The constant TP_CALY_XPT2046 = 122224794 === 0x749009A Masking that value with 0x3FFF returns 0x009A - that's ybottom Shifting TP_CALY right by 16 bits and masking with 0x3FFF returns 0x0749 - thats ytop.

It's a constant calculation so I'm puzzled that it's recomputed every reading. I'm not too sure what's intended.

nottledim avatar Nov 24 '17 11:11 nottledim

Hi nottledim,

I'm having the similar issue with the XPT2046 touch calculations. Were you able to resolve it? Please let me know if you have found the solution to this issue.

Thanks in advance!

SindhujaNarra avatar Jun 07 '18 19:06 SindhujaNarra

oh, gosh - yes and no. I got it to work well enough for what I wanted by fiddling about. I don't think you could call it a resolution.

If I remember there was a problem with the mask used to select the position value from the chip register.

I'll dig the code out tomorrow to remind myself and I'll also send it to you.

Dick

On 7 June 2018 20:19:05 Sindhuja Narra [email protected] wrote:

Hi nottledim,

I'm having the similar issue with the XPT2046 touch calculations. Were you able to resolve it? Please let me know if you have found the solution to this issue.

Thanks in advance!

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/loboris/ESP32_TFT_library/issues/22#issuecomment-395534756

nottledim avatar Jun 07 '18 20:06 nottledim

That would be great. Thanks a lot!

SindhujaNarra avatar Jun 07 '18 21:06 SindhujaNarra

I am experiencing the same issue, was anyone able to resolve the issue with the XPT2046 touch calculation? Thank you

earosenfeld avatar Jul 11 '19 18:07 earosenfeld