#include "DHT.h"          

float seuil_min=75;
float seuil_max=85;
int broche_mesure = 4;
int broche_commande =12;
DHT dht(broche_mesure, DHT22); 

void setup(){
  dht.begin();
  Serial.begin(74880);
  pinMode(broche_commande, OUTPUT);
  digitalWrite(broche_commande, LOW); 
}

void loop() {
  float hum = dht.readHumidity(); 
  if (isnan(hum)) {
    Serial.println("Erreur de communication!"); 
  }else{    
    Serial.println(hum);                  
    if (hum>seuil_max){
      digitalWrite(broche_commande, HIGH);
    }
    if (hum<seuil_min){
      digitalWrite(broche_commande, LOW);
    }
  }
  delay(60000);
}


