master
Holger Wirtz 4 years ago
parent a1c052308a
commit e49e58fbbb
  1. 16
      WLAN_Thermometer.ino

@ -34,9 +34,9 @@
LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW); LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COL, LCD_ROW);
looper sched; looper sched;
float temp[3]; float temp[3] = { NAN, NAN, NAN };
float hum[3]; float hum[3] = { NAN, NAN, NAN };
float heat[3]; float heat[3] = { NAN, NAN, NAN };
bool led_state; bool led_state;
String header; String header;
WiFiServer server(80); WiFiServer server(80);
@ -377,6 +377,7 @@ void show_time(void)
{ {
strcpy(date_string, "--:--:----"); strcpy(date_string, "--:--:----");
strcpy(time_string, "--:--:--"); strcpy(time_string, "--:--:--");
DateTime.forceUpdate();
} }
if (strcmp(date_string, date_string_old)) if (strcmp(date_string, date_string_old))
@ -491,10 +492,10 @@ void get_sensor_data(void)
heat[ACT] = NAN; heat[ACT] = NAN;
if (minmax_enabled == false && millis() > FIRST_MIN_MAX) if (minmax_enabled == false && millis() > FIRST_MIN_MAX)
{ minmax_enabled = true;
if (!isnan(temp[ACT]) && !isnan(hum[ACT]) && !isnan(heat[ACT]))
minmax_enabled = true;
if (minmax_enabled == false)
{
if (!isnan(temp[ACT])) if (!isnan(temp[ACT]))
{ {
temp[MIN] = temp[ACT]; temp[MIN] = temp[ACT];
@ -513,8 +514,7 @@ void get_sensor_data(void)
heat[MIN] = heat[ACT]; heat[MIN] = heat[ACT];
} }
} }
else
if (minmax_enabled == true)
{ {
if (!isnan(temp[ACT])) if (!isnan(temp[ACT]))
{ {

Loading…
Cancel
Save