M5-TOUGH / unable to change display brightness

  • Hi.

    I'm using the latest library via Platformio (lib_deps = https://github.com/m5stack/M5Tough) and am unable to change the display brightness.

    My code is as simple as this:


    This does not change anything on the display.

    It works with the M5-Core2 module though.

    Can anybody confirm the SetLcdVoltage works for the M5-TOUGH?

    Thanks and have a great week.

  • no M5-Core to try

    class M5Display : public TFT_eSPI {
          static M5Display* instance;
          void begin();
          void sleep();
          void wakeup();
          void setBrightness(uint8_t brightness);
          void clearDisplay(uint32_t color=ILI9341_BLACK) { fillScreen(color); }
          void clear(uint32_t color=ILI9341_BLACK) { fillScreen(color); }
          void display() {}

    so you can try this

    #include <M5Display.h>
    M5.Lcd.setBrightness(value);    //uint8_t  Brightness (0: Off - 255:Full)

  • Hi.

    No Luck with M5.Axp.SetLcdVoltage(...);
    The value has to be from 0-255 anyway.

    At the backside they mentioned the backlight:
    "BL: ACP_LDO3"

    So this seems to the same as in Core2.

  • @erazor I have an "always on" project using Core Basic. I use
    M5.Lcd.setBrightness(75); //75 is high
    M5.Lcd.setBrightness(10); //10 is low
    Works well, you can try different values to suit.
    My other application runs on a Core2 and I use:
    if (enable) {
    M5.Axp.SetLcdVoltage(2900); //3000 very bright
    } else {
    M5.Axp.SetLcdVoltage(2600); //2500 way too dark, 2600 very dim

  • Well, yeah... but nothing works with the M5-TOUGH which should support it via the Axp.

  • Hello @erazor

    have a look at the AXP192.cpp where SetLDOVoltage() is used to manipulate LDO3 (aka brightness). Use it like below in your code.



  • @felmue said in M5-TOUGH / unable to change display brightness:


    Hi Felmue!

    That one works, thanks a lot!

    Really confusing that there is a PWM backlight LED mentioned in the library which does not work. And that the usage of SetLcdVoltage is inconsistent between the Core2 and TOUGH.

    On Core2 the LcdVoltage changes DCDC3 (@param number 0=DCDC1 / 1=DCDC2 / 2=DCDC3 ) which is connected to LCD_BL. For the TOUGH on the other hand DCDC3 is unused and they used the LDO3.

    So maybe they should simply change the line SetDCVoltage(2, voltage); to M5.Axp.SetLDOVoltage(3,voltage); or maybe even better introduce a new function SetLCDBacklightVoltage(...) in their library.

    Thanks to all for your hints.