Interpolation zum Berechnen der Feuchte
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -26,6 +26,7 @@
|
||||
#include "mqtt.h"
|
||||
#include "handlebme280.h"
|
||||
#include "grafik.h"
|
||||
#include "interpolation.h"
|
||||
#include "main.h"
|
||||
|
||||
#include <locale.h>
|
||||
@@ -70,6 +71,7 @@ void setup() {
|
||||
Serial.println("LVGL started");
|
||||
|
||||
bmedata = readBME280();
|
||||
bmedata.hum = getRelativeFeuchte(bmedata.temp, bmedata.hum);
|
||||
arcTemp.value = bmedata.temp;
|
||||
arcHum.value = bmedata.hum;
|
||||
delay(1000);
|
||||
@@ -103,7 +105,17 @@ void setup() {
|
||||
*/
|
||||
delay(1000);
|
||||
|
||||
/* Test Routinen
|
||||
const float tsttemp[] = {27.7, 26.9, 26.7, 26.7, 26.0};
|
||||
const float tsthum[] = {62.0, 53.0, 50.0, 48.0, 39.0};
|
||||
for (int i = 0; i < 5; i++) {
|
||||
Serial.printf("%d temp: %.1f hum: %.1f relF: %d\n", i, tsttemp[i], tsthum[i], getRelativeFeuchte(tsttemp[i], tsthum[i]));
|
||||
}
|
||||
|
||||
while (1) {
|
||||
delay(1000);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void loop() {
|
||||
@@ -114,6 +126,7 @@ void loop() {
|
||||
if (millis() - bmeReadtimer > bmeReadTime) {
|
||||
bmeReadtimer = millis();
|
||||
bmedata = readBME280();
|
||||
bmedata.hum = getRelativeFeuchte(bmedata.temp, bmedata.hum);
|
||||
doPublish(bmedata.temp+arcTemp.value_offset, bmedata.hum+arcHum.value_offset, bmedata.temp, bmedata.hum);
|
||||
}
|
||||
if (millis() - updatetimer > updateTime) {
|
||||
|
||||
Reference in New Issue
Block a user