0.46 Korekra isnan; reorganizacjia plików

This commit is contained in:
Kamil Siejka
2025-03-03 15:40:13 +01:00
parent b31a253192
commit fb26fd60a6
5 changed files with 21 additions and 2 deletions

View File

@@ -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();