aselectroworks / Arduino-FT6336U

FocalTech FT6336U (Self-Capacitive Touch Panel Controller) library for Arduino.
MIT License
40 stars 14 forks source link

How to rotate the touch screen ? No function exists #9

Open pistojim opened 1 year ago

pistojim commented 1 year ago

Resistive touch screen XPT2026 has a function touch.setRotation(1); How can we do the same with capacitive FT6336U ?

pistojim commented 1 year ago

For the moment I solve it like that :

// X_Coord = tp.tp[0].x; // no flip // Y_Coord = tp.tp[0].y; // no flip

X_Coord = tp.tp[0].y;    // X <-> Y flip
Y_Coord = tp.tp[0].x;    // X <-> Y flip

X_Coord = 320 - X_Coord;   //180 degrees flip X axis
//Y_Coord = 240 - Y_Coord;  //180 degrees flip Y axis
asasaki-shiftall commented 1 year ago

This library does not provide setRotaion function. So you need to calculate rotation by yourself