2025-12-1205
This commit is contained in:
29
include/mess_htu21.h
Normal file
29
include/mess_htu21.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "Adafruit_HTU21DF.h"
|
||||
|
||||
const float No_Valhtu = 999.99;
|
||||
|
||||
struct {
|
||||
char temperature[15] = {0};
|
||||
char humity[15] = {0};
|
||||
float Temp = No_Valhtu;
|
||||
float Feuchte = No_Valhtu;
|
||||
} htu21Data;
|
||||
|
||||
Adafruit_HTU21DF htu = Adafruit_HTU21DF();
|
||||
|
||||
|
||||
void init_HTU21(){
|
||||
if (!htu.begin()) {
|
||||
Serial.println("Couldn't find sensor HUT21D!");
|
||||
while (1);
|
||||
}
|
||||
Serial.println("HUT21D gefunden");
|
||||
}
|
||||
|
||||
void read_HTU21D() {
|
||||
htu21Data.Temp = htu.readTemperature();
|
||||
htu21Data.Feuchte = htu.readHumidity();
|
||||
//htu21Data.Temp = htu21Data.Temp + HTU_Korrectur;
|
||||
//htu21Data.Feuchte = htu21Data.Feuchte + HTUKorrekturFeuchte;
|
||||
Serial.printf("HTU21D: Temperarur Innen %3.2f °C und\n Luftfeuchtigkeit %3.2f %%\n\n", htu21Data.Temp, htu21Data.Feuchte );
|
||||
}
|
||||
Reference in New Issue
Block a user