Giter Site home page Giter Site logo

Comments (8)

JoaoLopesF avatar JoaoLopesF commented on August 24, 2024 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

from spfd5408.

ystrem avatar ystrem commented on August 24, 2024

+1

from spfd5408.

hevergreen avatar hevergreen commented on August 24, 2024

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

#define YP A1 // must be an analog pin, use "An" notation!
#define XM A2 // must be an analog pin, use "An" notation!
#define YM 7 // can be a digital pin
#define XP 6 // can be a digital pin

to
#define XM A1 // must be an analog pin, use "An" notation!
#define YP A2 // must be an analog pin, use "An" notation!
#define XP 7 // can be a digital pin
#define YM 6 // can be a digital pin

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!!

from spfd5408.

detectingdragon77 avatar detectingdragon77 commented on August 24, 2024

Thank You, the only working way ive found on the internet!!!!

from spfd5408.

mike-mustermann avatar mike-mustermann commented on August 24, 2024

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

from spfd5408.

mike-mustermann avatar mike-mustermann commented on August 24, 2024

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

from spfd5408.

mike-mustermann avatar mike-mustermann commented on August 24, 2024

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

from spfd5408.

mike-mustermann avatar mike-mustermann commented on August 24, 2024

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

from spfd5408.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.