This commit is contained in:
Oleg Kalachev
2026-08-16 00:04:05 +03:00
parent 8fe1a525bf
commit 23e1e7bd22
+3 -2
View File
@@ -29,10 +29,11 @@ void readVoltage() {
static Rate rate(10); static Rate rate(10);
if (!rate) return; if (!rate) return;
float v = 0;
#if defined(ESP32) #if defined(ESP32)
float v = analogReadMilliVolts(voltagePin) * voltageScale / 1000.0f; v = analogReadMilliVolts(voltagePin) * voltageScale / 1000.0f;
#elif defined(ARDUINO_ARCH_STM32) #elif defined(ARDUINO_ARCH_STM32)
float v = analogRead(voltagePin) * voltageScale * 3.3f / 4095.0f; v = analogRead(voltagePin) * voltageScale * 3.3f / 4095.0f;
#endif #endif
voltage = voltageFilter.update(v); voltage = voltageFilter.update(v);