From ce08e4c211976c7b84e1d89fa22c122fc068d5ea Mon Sep 17 00:00:00 2001 From: Tobias Maier Date: Sat, 28 Oct 2023 19:17:00 +0200 Subject: [PATCH] Added --- platformio.ini | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index b75763a..29ba966 100644 --- a/platformio.ini +++ b/platformio.ini @@ -20,4 +20,4 @@ lib_deps = ArduinoLog upload_protocol = espota -upload_port = 192.168.4.18 \ No newline at end of file +upload_port = 10.0.3.50 \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index ecee195..78e555b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -96,7 +96,7 @@ Preferences prefs; AsyncWebServer server(80); #define FORMAT_LITTLEFS_IF_FAILED true -void display_percentage(int percentage) +void display_percentage(float percentage) { digitalWrite(LED_RED, 0); @@ -295,7 +295,7 @@ void read_sensor_task(void* parameter) // Raw unrounded percentage in decimal float percentage_raw = (shunt_current_over_zero / (max_water_level_mA_over_zero - min_water_level_mA_over_zero)); - float percentage_rounded = round(percentage_raw*100*100)/100; + float percentage_rounded = round(percentage_raw*100); // Tank volume in liters float liters_raw = max_liters * percentage_raw;