russhughes / ili9342c_mpy

ILI9342C Fast 'C' Driver for MicroPython (M5Stack Core)
Other
52 stars 13 forks source link

Inverted screen #3

Closed jajito closed 3 years ago

jajito commented 3 years ago

Hi, congratulations for your excellent job. I have installed your ST7789 firmware on my TTGO T-Display and it is marvellous. I am trying to use your ili9342c firmware with the TTGO T4, and found some issues that I have solved. The connection of the pins that appears in the TTGO web is not correct. This one works: MOSI 23 CLK 18 CS 27 DC 32 (THIS IS WRONG IN THE INFO OF THE MODULE) RST 5 Backlight Pin 4 (You have to use your library option backlight=Pin(4, Pin.OUT)) Now the screen works, but colours and screen are inverted. I have used your library option tft.inversion_mode(0) and the colours now are ok. But the screen is still inverted. Is there any solution for that? Thanks in advance, congratulations for your wonderful job and keep on helping us!

spi = SPI(
        2,
        baudrate=40000000,
        polarity=1,
        phase=1,
        sck=Pin(18),
        mosi=Pin(23))

    # initialize display

tft = ili9342c.ILI9342C(
        spi,
        240,
        320,
        reset=Pin(5, Pin.OUT),
        cs=Pin(27, Pin.OUT),
        dc=Pin(32, Pin.OUT),
        backlight=Pin(4, Pin.OUT),
        rotation=0
        )
tft.init()
tft.inversion_mode(0)
russhughes commented 3 years ago

By inverted, do you mean side down or are the colors wrong? If upside down, look at the rotation parameter. If its a color issue can you show me a picture of whats happening?

jajito commented 3 years ago

Thanks!. The colours are fixed with inversion_mode(0). I mean inverted like a mirror.

jajito commented 3 years ago

IMG20210412084821

russhughes commented 3 years ago

This appears to be a difference in how the ili9341 handles memory writing compared to the ili9342c. Other drivers support 4 additional rotation settings that are also mirrored. I'll add support for this but I will need to look and see if I have a ili9341 display for testing.

jajito commented 3 years ago

Thank you very much!

russhughes commented 3 years ago

I uploaded new drivers, try rotation values 4 through 7. I'm not sure they are all correct as I do not have access to a ILI9341 to test. They appear mirrored on my display so I think they will appear correctly on yours.

jajito commented 3 years ago

Now it works, the mirrored option is perfect. Thanks Russ for your job.

russhughes commented 3 years ago

Excellent.

aguaviva commented 2 years ago

This works like a charm!