Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm working with a FocalTech FT6336G touch screen module. The FT6336G module interfaces with ESP32_devKit through an I2C interface. Currently I'm working on the flash memory and compiling a program in ESP_IDF.

For Hardware testing, I use an Arduino-based library , which I flash into the ESP32.

The FT6336G Touch screen appears to be working fine.

So for help, I try to follow the Arduino code pattern and exactly map it with an ESP_IDF-based I2C example , but I'm still not getting a satisfying result.

Currently, I'm working on this code . I need a suggestion about what kind of changes are required to get (X,Y) coordinates from the FT6336G touch screen.

At present, I get a 4-byte result from I2c_read function. I'm trying to convert this result through the given Arduino code, focussing only on the functions Touch_demo() and Touch_Init() . I try to convert the 4 bytes with the conversion given by the Touch_demo() function, but I am not getting the expected coordinates like x-axis (right to left) 0-256 and Y-axis (top to bottom) 0-256.

Can you give me a suggestion on these details.

The style of the question was somewhat hard to understand. I tried to clean up grammar and formulation to conserve and transport its meaning as good as I could. @PratikjPanchal - Please review if the result matches your original intention. HelpingHand May 2, 2020 at 21:20

This is one of the reason I avoid using other people's libraries, because I never find them useful. Currently I am working on writing my own library for the FT6336G, but I need to figure it out as well, so unfortunately I cannot provide much information.

However, I managed to find the datasheet for this controller which contains all the important information you might need. Here: FT6236-FT6336-FT6436L-FT6436_Datasheet.pdf

If you look at the 'Register Mapping' on page 26, you will see how the X and Y touch coordinates are read in 2 bytes. So you need a 2-byte buffer for each coordinate that will filter out the Touch ID (first 4 bits) and read the remaining 12 bits that hold the actual value.

There is also some sample code at the end that might help you modify the read function that receives the touches. I hope this helps.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .