[SOLVED] 0.96" display with esp32, inverted font!

Hi All,

So I have a weird problem. On my display, I have my font inverted (see pic). I'm using Adafruit libraries.

I'm just trying to show on screen - "100 Hello"
but its inverted, please see attached image.
Thoughts?

tft.initR(INITR_MINI160x80);          // Init ST7735S mini display
tft.invertDisplay(true);
tft.setRotation(2);
tft.fillScreen(ST77XX_RED);
tft.testdrawtext("100 Hello", ST77XX_WHITE);

Post a link to the actual display that you have bought.

This display was taken out of a cheap Chinese watch -
https://www.amazon.in/gp/product/B08P8TF7MM/

I have a demo board as well and tried the same code on that. Aaaaand it was correct on it... see attached image.
pff, still, any thoughts on how to fix it on the previous display or should I chuck it (really don't want to chuck it as I have a few lying around).

Ah-ha. 449 rupees is about £4.50. So that is pretty cheap.

Your "working module" is actually displaying in PORTRAIT_REV i.e. upside down.

The Adafruit INITR_MINI160x80 suits their displays but does not always suit Ebay displays.

The simple answer is : panels come in all shape, sizes, and directions.

You can either initialise to suit your panel or just write to the register during your application.

You might find this thread about 160x80 colours
interesting.

You can edit the Adafruit_ST7735.cpp setRotation() method e.g.

  switch (rotation) {
  case 0:
    if ((tabcolor == INITR_BLACKTAB) || (tabcolor == INITR_MINI160x80)) {
      madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_RGB;
    } else {
      madctl = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST7735_MADCTL_BGR;
    }

remove the ST77XX_MADCTL_MX item from the expression

Alternatively:

#if WEIRD_160x80
  madctl ^=   ST77XX_MADCTL_MX;
#endif
  sendCommand(ST77XX_MADCTL, &madctl, 1);
}

Or you just correct the MADCTL register in your sketch e.g.

   uint8_t madctl = 0x88;
   tft.sendCommand(0x36, &madctl, 1);
}

David.

makes sense, I perhaps need to play with the drivers. I have tinkered with these before. I'll post a solution here if I'm successful, else I will have an added cost to procure displays separately.

Those watches are cheap as I need the whole set for my project, except the PCB, so I designed the exact PCB and replaced MCU with ESP32 :slight_smile:

Wow thank god, I refreshed the page, and saw the edit!
Your first solution worked for me! Thanks!
I was so close to cracking it... I realized I need to tinker with MADCTL and opened the Datasheet of ST7735S, and was playing with the combinations, but you solved it for me. Thanks mate!

Here is the pic of the watch for you (final.jpg) and the weird display (final 2.jpg)

PS - I guess it broke the setRotation() and setCursor(), but I found the solution and can fix these functions, so all cool. Thanks again for your help! :slight_smile:

This topic was automatically closed after 120 days. New replies are no longer allowed.