From e49e58fbbb31c0bba671c8319e2b3b253f328c23 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 16 Nov 2020 13:16:04 +0100 Subject: [PATCH] Fixes. --- WLAN_Thermometer.ino | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/WLAN_Thermometer.ino b/WLAN_Thermometer.ino index b8fe29c..3533b02 100644 --- a/WLAN_Thermometer.ino +++ b/WLAN_Thermometer.ino @@ -34,9 +34,9 @@ LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW); looper sched; -float temp[3]; -float hum[3]; -float heat[3]; +float temp[3] = { NAN, NAN, NAN }; +float hum[3] = { NAN, NAN, NAN }; +float heat[3] = { NAN, NAN, NAN }; bool led_state; String header; WiFiServer server(80); @@ -377,6 +377,7 @@ void show_time(void) { strcpy(date_string, "--:--:----"); strcpy(time_string, "--:--:--"); + DateTime.forceUpdate(); } if (strcmp(date_string, date_string_old)) @@ -491,10 +492,10 @@ void get_sensor_data(void) heat[ACT] = NAN; if (minmax_enabled == false && millis() > FIRST_MIN_MAX) - { - if (!isnan(temp[ACT]) && !isnan(hum[ACT]) && !isnan(heat[ACT])) - minmax_enabled = true; + minmax_enabled = true; + if (minmax_enabled == false) + { if (!isnan(temp[ACT])) { temp[MIN] = temp[ACT]; @@ -513,8 +514,7 @@ void get_sensor_data(void) heat[MIN] = heat[ACT]; } } - - if (minmax_enabled == true) + else { if (!isnan(temp[ACT])) {