Problem with TFT 3.5" touch screen

Hi there everyone!

I made a project for my fiance with touch screen and stepper motor, it has many different buttons and menus, and I've already made a few updates and changes... Project is completed as of it's hardware, but I'm constantly working on new software features and updates.
Not to bother you any more with not that important info, let's get straight to the problem. I'm using 3.5" MCU friend TFT screen for this project, I have calibrated it few times and it was working very good until yesterday. I wanted to make some changes and fix some software bugs and I found out that there is some problem with Touch Screen... Nothing was changed inside code that could affect touch screen, so I dived deeply into the problem and found out that there is a slight offset with my touch screen, but display itself is ok.

For example:
I use X & Y coordinates to determine where the screen is press and which on-screen button should be activated. Below this I will write coordinates that correspond to all four corners of the screen (how they was and should be).

Landscape orientation (with correct coordinates)
TOP left: ............... X = 0 | Y= 0
TOP right: ............ X = 480 | Y= 0
BOTTOM left: ...... X = 0 | Y= 320
BOTTOM right: ... X = 480| Y= 320

Landscape orientation (ISSUE)
TOP left: ............... X = 0 | Y= 0
TOP right: ............ X = 480 | Y= -27
BOTTOM left: ...... X = 0 | Y= 267
BOTTOM right: ... X = 484| Y= 321

So obviously something is in offset with Y coordinate. X is pretty consistent across whole screen line, but I hope you see my problem, as I can't control buttons while any of my coordinates isn't consistent across whole screen. I can only use "rectangular" shape coordinates inside IF statements to determine which button is pressed.
In my case, now if I press closer to the left side of the screen, all my Y coordinates are slightly lower value, this means that wrong button is going to be picked.

I have another new TFT screen that I can try with, but I just wanted to check with you guys if you have any idea what could be the problem except TFT itself.

Thanks in advance :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.