   digitalWrite(out1, LOW);
   fanOn = false;
   
-  //init DHT device
-  dht.begin();
-  //sensor_t sensor;
+  dht.setup(dhtPin);
+  //Serial.println(F("setup end"));
 
 }
 
-unsigned long task, task1, task2 = 0;
+unsigned long task1, task2 = 0;
 void loop() {
   unsigned long currmillis = millis();
 
   //falls der Luefter laeuft pruefe alle 5 Sekunden die Werte
   if (fanOn) {
-    if ((unsigned long)(currmillis - task2) >= 5000) {
+    if ((unsigned long)(currmillis - task2) >= 15000) {
       byte i;
       //Serial.println(F("check if hum"));
       if ((float)(get_hum() <= 65.0 || get_hum() <= 70.0)) {
         if (!fanOn) {
           //oeffne die Belueftung und starte den Luefter
+          //Serial.println(F("fan ON"));
           digitalWrite(out1, HIGH);
           fanOn = true;
         }
       } else {
         if (fanOn) {
           // switch fan1 off und schliesse den Schlitz
+          //Serial.println(F("fan off"));
           digitalWrite(out1, LOW);
           fanOn = false;
         }

byte ID = 10;
//VirtualWire lib
#include <VirtualWire.h>
/* //mit dieser Option gibt es einen Fehler beim Kompilieren
#undef int
#undef abs
#undef double
#undef float
#undef round
*/
int txPin = 3; //ueber Pin 3 die Daten senden

int out1 = 1;

/*
// Reservierung fuer Display
int sclPin = 2;
int scaPin = 0;
*/

int dhtPin = 4;
//DHT11 und 22 lib
#include <DHT.h>
#include <DHT_U.h>
#define dhtPin 4 //DHT Pin
// Uncomment the type of sensor in use:
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
DHT_Unified dht(dhtPin, DHTTYPE);

//Pausen zwischen den Messungen in Millisekunden
unsigned long stime = 10000; // Zeit fuer Daten Senden
unsigned long mtime = 10000; // Zeit fuer die Daten Messung

boolean fanOn; // Boolean Feld fuer den Status vom Luefter.



  vw_send((uint8_t *)&wData, sizeof(wData));
  vw_wait_tx();
}

