-->
Page 2 of 3

Re: TFT ILI9341 display touch controller x axis reversed

PostPosted: Sun Jul 24, 2016 10:31 pm
by Mmiscool
Hello.

All of the delay(0)s are to prevent the esps internal watchdog from triggering. Then the delay 0 is run it lets the wifi stack and other things happen in the background. It is important not to have tight loops with out a delay 0 otherwise it will crash and reboot.

Also can you highlight the lines of code you changed. I might need to add this to the touch set up code to make this some thing that the user can define.

Re: TFT ILI9341 display touch controller x axis reversed

PostPosted: Sun Jul 24, 2016 10:39 pm
by Mmiscool
Hello.

All of the delay(0)s are to prevent the esps internal watchdog from triggering. Then the delay 0 is run it lets the wifi stack and other things happen in the background. It is important not to have tight loops with out a delay 0 otherwise it will crash and reboot.

Also can you highlight the lines of code you changed. I might need to add this to the touch set up code to make this some thing that the user can define.

Re: TFT ILI9341 display touch controller x axis reversed

PostPosted: Mon Jul 25, 2016 11:32 am
by lpservices
Hello,

this is the codeblock in ReadTouchXY I replaced for the reversed X axis on my display:

my altered code:

switch (tft->getRotation())
{
case 0:
xf = 240 -x;
yf = y;
break;
case 1:
xf = y;
yf = x;
break;
case 2:
xf = x;
yf = 320-y;
break;
case 3:
xf = 320 -y;
yf = 240 - x;
break;
}

The original code :

switch (tft->getRotation())
{
case 0:
xf = 240 - x;
yf = 320 - y;
break;
case 1:
xf = 320 - y;
yf = x;
break;
case 2:
xf = x;
yf = y;
break;
case 3:
xf = y;
yf = 240 - x;
break;
}
This solved my problem for all rotations of the display, hope this of some use to other buyers of this display
At the moment I am looking at implementing a calibration routine to implement tft.calibrate()

Re: TFT ILI9341 display touch controller x axis reversed

PostPosted: Sun Apr 05, 2020 11:37 pm
by tzuanich
I am seeing XY inverted on the touch screen, has that issue been fixed?