rdagger / micropython-ili9341

MicroPython ILI9341Display & XPT2046 Touch Screen Driver
MIT License
185 stars 38 forks source link

mirror touch axes #18

Closed Synec5 closed 10 months ago

Synec5 commented 10 months ago

Hello, I can mirror touch axes in the file xpt2046.py

With kind regards

rdagger commented 10 months ago

If I understand correctly, you're asking about mirroring touch coordinates. If that's the case, one possible solution could be subtracting the X coordinate from the width and the Y coordinate from the height.

Synec5 commented 10 months ago

Yes that works. I would like to define it in the driver file or adapt it to the appropriate location/variables.

rdagger commented 10 months ago

xpt2046.py has both self.width and self.height so you just need to make the adjustment prior to the x,y values being returned in get_touch() and/or int_press().