🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5-TOUGH / unable to change display brightness

    PRODUCTS
    4
    7
    5.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      erazor
      last edited by

      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:

      M5.Axp.SetLcdVoltage(2500);
      

      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.

      1 Reply Last reply Reply Quote 0
      • F
        flypeek
        last edited by

        no M5-Core to try
        https://github.com/m5stack/M5Tough/blob/master/src/M5Display.h

        class M5Display : public TFT_eSPI {
            public:
              static M5Display* instance;
              M5Display();
              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)
        1 Reply Last reply Reply Quote 0
        • E
          erazor
          last edited by

          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.

          teastainT 1 Reply Last reply Reply Quote 0
          • teastainT
            teastain @erazor
            last edited by

            @erazor I have an "always on" project using Core Basic. I use
            M5.Lcd.setBrightness(75); //75 is high
            and
            M5.Lcd.setBrightness(10); //10 is low
            Works well, you can try different values to suit.
            -Terry
            P.S.
            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
            }

            Cheers, Terry!

            100% M5Stack addict with several drawers full of product!

            1 Reply Last reply Reply Quote 0
            • E
              erazor
              last edited by

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

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by

                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.

                M5.Axp.SetLDOVoltage(3,3000);
                

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • E
                  erazor
                  last edited by

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

                  M5.Axp.SetLDOVoltage(3,3000);

                  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.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post