m5stack / M5Stack

M5Stack Arduino Library
MIT License
1.19k stars 425 forks source link

M5.Power.isCharging() return false when Battery module attached #294

Closed christophepersoz closed 12 months ago

christophepersoz commented 1 year ago

Describe the bug

If you are connecting the Battery Module underneath the M5Stack and then you plug USB-C cable onto a power charger, Power.isCharging() function still return false while it should return true.

To reproduce

Latest M5-Stack library version under Arduino Framework.

Expected behavior

Return true as soon as connecting to a power source whether a battery module is attached or not

Screenshots

No response

Environment

Additional context

No response

Issue checklist

Tinyu-Zhao commented 12 months ago

Do you initialize the power module before calling M5.Power.isCharging()? M5.Power.begin(); // Init Power module.

I tested it with no problem. IMG_6059