mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-07-17 14:22:25 +00:00
Optimize ADC readout
This commit is contained in:
@@ -70,11 +70,11 @@ uint16_t HeltecV4R8Board::getBattMilliVolts() {
|
||||
|
||||
uint32_t raw = 0;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
raw += analogRead(PIN_VBAT_READ);
|
||||
raw += analogReadMilliVolts(PIN_VBAT_READ);
|
||||
}
|
||||
raw = raw / 8;
|
||||
|
||||
return (adc_mult * (3.3f / 4096.0f) * raw) * 1000;
|
||||
return (adc_mult * raw);
|
||||
}
|
||||
|
||||
const char* HeltecV4R8Board::getManufacturerName() const {
|
||||
|
||||
Reference in New Issue
Block a user