Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. OnRed
    O
    • Continue chat with OnRed
    • Start new chat with OnRed
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    OnRed

    @OnRed

    0
    Reputation
    1
    Posts
    893
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    OnRed Follow

    Posts made by OnRed

    • RE: Battery status?

      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.

      posted in M5 Stick/StickC
      O
      OnRed