We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3d7f82 commit f7845c2Copy full SHA for f7845c2
libraries/Nicla_System/src/Nicla_System.cpp
@@ -292,8 +292,9 @@ int8_t nicla::getBatteryVoltagePercentage(bool useLatchedValue) {
292
if(chargingEnabled) {
293
disableCharging();
294
}
295
- // Write 1 to VBMON_READ to trigger a new reading
296
- _pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_BATT_MON, 1);
+ // Write 1 to bit 7 VBMON_READ to trigger a new reading
+ _pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_BATT_MON, 0b10000000);
297
+
298
delay(3); // According to datasheet, 2ms is enough, but we add 1ms for safety
299
300
0 commit comments