Skip to content

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

@callpla

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions