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

x, y coordinates are flipped compared to FT5336 touch screen and Arduino library #20

Open
BlitzCityDIY opened this issue Dec 8, 2023 · 1 comment

Comments

@BlitzCityDIY
Copy link

i've been working with the new revision 3.5" TFT breakout that uses this display along with the FT5336 touch screen driver. i've found that the touch screen coordinates and the display coordinates in CircuitPython do not match by default. However, in Arduino they do match.

0, 0 for the FT5336 and Arduino is here:
0-0_ft ard_5846-04

whereas by default in CircuitPython it's here:
0-0_cp

additionally, in arduino the display defaults to 320x480. this matches the incoming x and y values from the FT5336.

as a workaround, i rotated the display by 90 and used flip_y and flip_x in the touchpaint example:

display = HX8357(display_bus, width=320, height=480, rotation=90)
...
tile_grid.flip_y = True
tile_grid.flip_x = True

i'm a little concerned that end users will bump into this and be confused so i'm curious if there is a way to update the library to account for this?

@makermelissa
Copy link
Contributor

Since you made it a separate library, you should just be able to use math to flip the result. Something like x = width - x.

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

2 participants