Bodmer / TFT_eFEX

A support library for TFT_eSPI that adds commonly used extra functions
Other
82 stars 27 forks source link

Flipping and reverse #34

Open ezkimos opened 3 years ago

ezkimos commented 3 years ago

Hi! I have two ips displays of size 1.14 and 1.8 on the st7789 and st7735 controllers. I also use your libraries for controllers. For use in an optical system, it is necessary to flip/reverse the image horizontally. Please help me where and how to edit the library. I found information only about rotation in 4 positions.

Bodmer commented 3 years ago

You need to send a command to the TFT MADCTL register 0x36 As an example for the ST7735, the bits are defined here. The command and bit functions in the driver data sheets.

In summary the MX, MV, MH, MV are the mirror x,y,horizontal and vertical flip bits. The bits you change will be dependant on the screen rotation you use. You can send the flip command from the sketch of change the library driver rotation code for each display type you use. Here is the rotation code for the ST7735, showing the default state of the bit settings.