Skip to content

Need a new release of battery API update. so can get battery level more accuracy when charging. #161

Description

@callpla

Need a new release of battery API. so can get battery level more accuracy when charging. thanks.

https://github.com/m5stack/M5Core2/commit/0134dd3a38cfd335a1ec39da2c149f88baf54326

     /// set battery charge enable.
    /// @param enable true=enable / false=disable
    void SetBatteryCharge(bool enable);

So we can temp disable battery charging, to read battery level.

  if(M5.Axp.isCharging()){
    M5.Axp.SetBatteryCharge(false);
    delay(10);
  }
  int batLevel = M5.Axp.GetBatteryLevel();
  M5.Axp.SetBatteryCharge(true);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions