From fb26fd60a659f3660139e1d5faecc7a75bb3e793 Mon Sep 17 00:00:00 2001 From: Kamil Siejka Date: Mon, 3 Mar 2025 15:40:13 +0100 Subject: [PATCH] =?UTF-8?q?0.46=20Korekra=20isnan;=20reorganizacjia=20plik?= =?UTF-8?q?=C3=B3w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => CollectedData}/Analiza okapu.xlsx | Bin ...sokościowa temperatura w sypialnixlsx.xlsx | Bin .../Battery analyze charge.xlsx | Bin .../Battery analyze dicharge.xlsx | Bin .../TempHumLoggerHomeKit.ino | 23 ++++++++++++++++-- 5 files changed, 21 insertions(+), 2 deletions(-) rename ESP32/TempHumLoggerHomeKit/{ => CollectedData}/Analiza okapu.xlsx (100%) rename ESP32/TempHumLoggerHomeKit/{ => CollectedData}/Analiza wysokościowa temperatura w sypialnixlsx.xlsx (100%) rename ESP32/TempHumLoggerHomeKit/{ => CollectedData}/Battery analyze charge.xlsx (100%) rename ESP32/TempHumLoggerHomeKit/{ => CollectedData}/Battery analyze dicharge.xlsx (100%) diff --git a/ESP32/TempHumLoggerHomeKit/Analiza okapu.xlsx b/ESP32/TempHumLoggerHomeKit/CollectedData/Analiza okapu.xlsx similarity index 100% rename from ESP32/TempHumLoggerHomeKit/Analiza okapu.xlsx rename to ESP32/TempHumLoggerHomeKit/CollectedData/Analiza okapu.xlsx diff --git a/ESP32/TempHumLoggerHomeKit/Analiza wysokościowa temperatura w sypialnixlsx.xlsx b/ESP32/TempHumLoggerHomeKit/CollectedData/Analiza wysokościowa temperatura w sypialnixlsx.xlsx similarity index 100% rename from ESP32/TempHumLoggerHomeKit/Analiza wysokościowa temperatura w sypialnixlsx.xlsx rename to ESP32/TempHumLoggerHomeKit/CollectedData/Analiza wysokościowa temperatura w sypialnixlsx.xlsx diff --git a/ESP32/TempHumLoggerHomeKit/Battery analyze charge.xlsx b/ESP32/TempHumLoggerHomeKit/CollectedData/Battery analyze charge.xlsx similarity index 100% rename from ESP32/TempHumLoggerHomeKit/Battery analyze charge.xlsx rename to ESP32/TempHumLoggerHomeKit/CollectedData/Battery analyze charge.xlsx diff --git a/ESP32/TempHumLoggerHomeKit/Battery analyze dicharge.xlsx b/ESP32/TempHumLoggerHomeKit/CollectedData/Battery analyze dicharge.xlsx similarity index 100% rename from ESP32/TempHumLoggerHomeKit/Battery analyze dicharge.xlsx rename to ESP32/TempHumLoggerHomeKit/CollectedData/Battery analyze dicharge.xlsx diff --git a/ESP32/TempHumLoggerHomeKit/TempHumLoggerHomeKit.ino b/ESP32/TempHumLoggerHomeKit/TempHumLoggerHomeKit.ino index 59d80ce..687c1f7 100644 --- a/ESP32/TempHumLoggerHomeKit/TempHumLoggerHomeKit.ino +++ b/ESP32/TempHumLoggerHomeKit/TempHumLoggerHomeKit.ino @@ -9,7 +9,7 @@ #include "SD.h" #include "SPI.h" -#define Version "0.45" +#define Version "0.46" #define WIRE Wire #define DHTTYPE DHT22 #define DHTPIN 4 //GPIO04 D4 @@ -322,6 +322,25 @@ void setup() { humHCalc = ( humH + lastHumH )/2; humMCalc = ( humM + lastHumM )/2; humLCalc = ( humL + lastHumL )/2; + + if (isnan(tempH)) { + lastTempH = 0.0; + tempH = lastTempH; } + if (isnan(tempM)) { + lastTempM = 0.0; + tempM = lastTempM;} + if (isnan(tempL)) { + lastTempL = 0.0; + tempL = lastTempL;} + if (isnan(humH)) { + lastHumH = 0.0; + humH = lastHumH;} + if (isnan(humM)) { + lastHumM = 0.0; + humM = lastHumM;} + if (isnan(humL)) { + lastHumL = 0.0; + humL = lastHumL;} //setup END //###################### } @@ -341,7 +360,7 @@ void loop() { tempH = (dhtH.readTemperature()-0.16); //kalibracja if (isnan(tempH)) { tempH = lastTempH;} tempM = (dhtM.readTemperature()+0.08); //kalibracja - if (isnan(tempH)) { tempM = lastTempM;} + if (isnan(tempM)) { tempM = lastTempM;} tempL = (dhtL.readTemperature()+0.0); if (isnan(tempL)) { tempL = lastTempL;} hum = dht.readHumidity();