Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Mmiscool
#51454 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.
User avatar
By Mmiscool
#51456 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.
User avatar
By lpservices
#51489 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()