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

    Battery status?

    M5 Stick/StickC
    core
    2
    2
    5.6k
    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.
    • J
      JoaoB
      last edited by

      Hi, is there any way to know the battery percentage of the M5Stick-C? I want to know when its "fully" charged and what is the real-time percentage of the battery!

      Thanks

      1 Reply Last reply Reply Quote 1
      • O
        OnRed
        last edited by

        I've just started out but it looks like the following shows the voltage and mine maxed out at 4.178V, this gradually decreases and I think below 3.6V isn't really usable. You can use this and some testing to determine the percentage of battery.

        #include "M5StickCPlus.h"
        
        TFT_eSprite Disbuff = TFT_eSprite(&M5.Lcd);
        
        void setup() {
            M5.begin();
            M5.Axp.ScreenBreath(8);
            M5.Lcd.setRotation(1);
        
            Disbuff.createSprite(240, 135);
            Disbuff.setTextColor(TFT_WHITE);
        }
        
        void loop() {
            Disbuff.fillRect(0, 0, 240, 135, TFT_BLACK);
            Disbuff.setCursor(10, 10);
            Disbuff.printf("BAT_V: %.3fV",M5.Axp.GetBatVoltage());
            Disbuff.pushSprite(0,0);
        }
        

        There are other options power functions that may help in this doc:
        AXP192 (Power management)

        Good luck.

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