Skip to content

Commit

Permalink
Fix high charge battery level mapping. (#68)
Browse files Browse the repository at this point in the history
Lower the battery level max so 4 bars is 85-100%.
Otherwise, anything less than 100% is 3 bars.
  • Loading branch information
gkoh authored Mar 1, 2024
1 parent 8623dd5 commit 29f1dcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/M5ez/src/M5ez.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ uint16_t ezBattery::loop() {
uint8_t ezBattery::getTransformedBatteryLevel() {
int32_t level = M5.Power.getBatteryLevel();

return map(level, 0, 100, 0, 4);
return map(level, 0, 85, 0, 4);
}

// Return the theme based battery bar color according to its level
Expand Down

0 comments on commit 29f1dcb

Please sign in to comment.