Page 1 of 1

Rotate function for Touch screen - landscape -

Posted: Wed Jun 07, 2023 9:05 am
by jandidden
I am using a 240 x 320 pix display with a touch screen overlay.
The display is used in landscape orientation which is simply using the DisplayOrientation() function of the ILI9341.
This allows rotation by 90, 180 or 270 degrees. 90 (or 270) degrees rotation gives you landscape mode.

But the touch screen overlay does not have this function (FT6X06).
In the FT6X06 properties area you can flip X and/or Y, but that does not allow rotating from portrait to landscape.
The rotation can be done in software I guess, but a rotate function as for the display would be a lot simpler and less error prone.

Something you would consider?

Jan

Re: Rotate function for Touch screen - landscape -

Posted: Wed Jun 07, 2023 9:42 am
by jandidden
Actually, it's really simple to do: just swap X and Y in the touch coordinate processing.
Use the reported X to find the Y touch position, and use the reported Y to find the X touch position.
And some scale factor tuning of course.

Jan