aselectroworks / Arduino-FT6336U

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

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

Open pistojim opened 11 months ago

pistojim commented 11 months ago

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

pistojim commented 11 months 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 11 months ago

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