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

    Documentation for ScreenBreath(): Is the parameter range 7 to 12 or 7 to 15?

    Bug Report
    1
    1
    2.2k
    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.
    • W
      wsanders
      last edited by wsanders

      https://github.com/m5stack/m5-docs/blob/master/docs/en/api/lcd_m5stickc.md#tft-screen says:

      Description: Adjust the brightness of the screen backlight.
      Parameter Description
      brightness TFT backlight brightness ( value: 7 - 15 )

      https://github.com/m5stack/m5-docs/blob/master/docs/en/api/axp192_m5stickc.md says:

      Description: Change the LDO3 output voltage of the AXP192 chip.
      parameter description
      brightness TFT backlight brightness (range: 7~12)

      In https://github.com/m5stack/M5Core2/blob/master/src/AXP192.cpp it's 0 to 100:

      void AXP192::ScreenBreath(int brightness) {
      int vol = map(brightness, 0, 100, 2400, 3300);

      In https://github.com/m5stack/M5StickC-Plus/blob/master/src/AXP192.cpp it's 0 to 100:

      void AXP192::ScreenBreath(int brightness) {
      if (brightness > 100 || brightness < 0) return;
      int vol = map(brightness, 0, 100, 2500, 3200);
      vol = (vol < 1800) ? 0 : (vol - 1800) / 100;

      Currently, with the Arduino M5StickCPlus library 0.0.8, the range seems to be 7 to 12. Also, 0 to 7 are not quite all the way off (very dim).

      [code]
      #include <M5StickCPlus.h>

      void setup() {
      M5.begin();
      M5.Lcd.setTextSize(5);
      M5.Lcd.setRotation(3);
      M5.Lcd.setTextColor(TFT_BLUE);
      }

      void loop() {
      int bright = 0;
      while (bright < 15) {
      M5.Lcd.fillScreen(WHITE);
      M5.Lcd.setCursor(20,20);
      M5.Axp.ScreenBreath(bright);
      M5.Lcd.println(bright);
      bright = bright + 1;
      M5.update();
      delay(2000);
      }
      while (bright < 100) {
      M5.Lcd.fillScreen(WHITE);
      M5.Lcd.setCursor(20,20);
      M5.Axp.ScreenBreath(bright);
      M5.Lcd.println(bright);
      bright = bright + 10;
      M5.update();
      delay(500);
      }
      }
      [/code]

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