#include "Adafruit_HTU21DF.h"

const float No_Valhtu = 0;

struct {
  char temperature[15] = {0};
  char humity[15] = {0};
  float Temp = No_Valhtu;
  float Feuchte = No_Valhtu;
  bool Status = true;
} htu21Data;

Adafruit_HTU21DF htu = Adafruit_HTU21DF();


void init_HTU21(){
    if (!htu.begin()) {
        Serial.println("Couldn't find sensor HUT21D!");
        htu21Data.Status = false;
    }
    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 );
}
