rak3x72: support variations in platformio.ini

This commit is contained in:
Florent
2025-06-25 13:55:54 +02:00
parent 816f3f8a6b
commit 387579922b
3 changed files with 18 additions and 5 deletions

View File

@@ -18,8 +18,12 @@ public:
}
uint16_t getBattMilliVolts() override {
uint32_t raw = analogRead(PIN_VBAT_READ);
return (ADC_MULTIPLIER * raw) / 1024;
analogReadResolution(12);
uint32_t raw = 0;
for (int i=0; i<8;i++) {
raw += analogRead(PIN_VBAT_READ);
}
return ((double)raw) * ADC_MULTIPLIER / 8 / 4096;
}
};