Closed DominikPalo closed 5 years ago
+1
Hi,
In mine TFTs I need invert the coords. Can be in your case it not necessary.
Please modify the SPFD5408_TouchScreen, line 159:
before:
//return TSPoint(x, y, z);
// *\ SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(x, 1023 - y, z); // -- End
after:
return TSPoint(x, y, z);
// *\ SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller //return TSPoint(x, 1023 - y, z); // -- End
If this ok, I can create an #define for this
Please send me if this ok now.
Regards
Joao
Solved this in a strange way, but works...
used this tip to invert some pins https://forum.arduino.cc/index.php?topic=405377.0
Swap the X and Y pin number in the sketch. Change this part: Original
to
and set the "SPFD5408_TouchScreen.cpp"to
//return TSPoint(x, y, z);
// *** SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(1023- x, 1023 - y, z); // -- End
Something tell me that I got a trick myself, but works!!
Thank You, the only working way ive found on the internet!!!!
For me this work fine. I played with the TSPoint parameters. And BAM! // *** SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(1100 - y, 1023 - x, 1023 - z); // -- End
For me this work fine. I played with the TSPoint parameters. And BAM! // *** SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(1100 - y, 1023 - x, 1023 - z); // -- End
For me this work fine. I played with the TSPoint parameters. And BAM! // *** SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(1100 - y, 1023 - x, 1023 - z); // -- End
For me this work fine. I played with the TSPoint parameters. And BAM! // *** SPFD5408 change -- Begin // SPFD5408 change, because Y coordinate is inverted in this controller return TSPoint(1100 - y, 1023 - x, 1023 - z); // -- End
I'm using your library with a 2.4 TFT touchscreen bought on eBay. All works fine, except the touch functionality - every
TSPoint
obtained usingTouchScreen.getPoint()
has inverted the Y-coordinate. It would by nice to have an option to set coordinate system forTouchScreen
instance (for example as optional parameter of theTouchScreen
constructor).I temporary fixed it by uncommenting the line #159 in the
SPFD5408_TouchScreen.cpp
file (return TSPoint(x, y, z);
).