In the case of:
xf = 240 -x;
x = 0 then xf = 240, I would expect the display to accept 0 to 239.... not 240
RichardS
lpservices wrote: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()
https://epartsconnect.com
Live realtime stock market prediction website. https://www.stocksignalslive.com my latest creation. Uses AI and machine learning.
New site featuring ESP8266 and ESP32 projects. tutorials, and news.
http://EverythingESP.com
ESP8266.com Founder and Administrator
The Mind Factory (get more from your 3D printer)
Home of the ESP8266, ESP8285, and ESP32 microcontrollers....