You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Volos, I'm not sure if AXP192 provides remaining battery charge, but I use this formula for estimating % remaining as a function of measured battery voltage. So you can pass this to the function below M5.Axp.GetBatVoltage();
/*----------------- Returns the estimated battery capacity remaining in a LiPo battery based on its measured voltage According to: Percentage = 123 - 123 / POWER(1 + POWER(Voltage /3.7, 80), 0.165)-----------------*/uint8_tlipo_capacity_percent(float voltage) {
float percent = 123.0 - (123.0 / pow(1 + pow(voltage / 3.7, 80), 0.165));
if (percent > 100.0) percent = 100.0;
if (percent < 0.0) percent = 0.0;
return (uint8_t)(round(percent));
}
The text was updated successfully, but these errors were encountered:
Hi Volos, I'm not sure if AXP192 provides remaining battery charge, but I use this formula for estimating % remaining as a function of measured battery voltage. So you can pass this to the function below
M5.Axp.GetBatVoltage();
The text was updated successfully, but these errors were encountered: