Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPT2046 touch calculation #22

Open
nottledim opened this issue Nov 24, 2017 · 4 comments
Open

XPT2046 touch calculation #22

nottledim opened this issue Nov 24, 2017 · 4 comments

Comments

@nottledim
Copy link

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.

@SindhujaNarra
Copy link

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!

@nottledim
Copy link
Author

nottledim commented Jun 7, 2018 via email

@SindhujaNarra
Copy link

That would be great. Thanks a lot!

@earosenfeld
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants