mirror of
https://github.com/okalachev/flix.git
synced 2026-08-16 00:38:56 +00:00
Fix
This commit is contained in:
+3
-2
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user