Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. JoaoB
    3. Topics
    J
    • Continue chat with JoaoB
    • Start new chat with JoaoB
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by JoaoB

    • J

      Battery status?
      M5 Stick/StickC • core • • JoaoB

      2
      1
      Votes
      2
      Posts
      578
      Views

      O

      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.
    • J

      M5Stick-C Battery Status?
      PRODUCTS • • JoaoB

      3
      0
      Votes
      3
      Posts
      912
      Views

      R

      I made custom block for UiFlow, there is also code in python. You shouldn't have problem with convert it to C language. https://github.com/stonatm/UiFlow-custom-blocks/tree/master/battery-capacity