I have a 2.8 inch TFT touch screen from Elegoo that I am using on a Mega2560. I am trying to make a touch display dashboard for a car project. At the moment I am just trying to get the display and input oriented. It normally displays in Portrait mode, but I have rotated in the code to Landscape as I intended. The problem is that the touch input still acts as if it is Portrait mode, and I am not sure how to adjust it. I attached my project file.
I have made 4 buttons, defined at Line 35, and created at Line 58 and 111.
I attached an image of what I got so far. The buttons are aligned as I want them, but the touch input is as if the screen was rotated 90 degrees CCW.
The rotation is set at Line 107.
I have messed with the code in Lines 138, 139, and 144 for the p.x and p.y assignments by swapping them, and it has shown to change the touch input’s position without altering the display, but in odd areas.
The code is based from an example provided from Elegoo that I modified, so there may be redundant or unneeded lines in it.
Can this be fixed in the project code, or have to be adjusted in the library?
Thanks for any help.
dash_01.ino (5.66 KB)