   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;
         }


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

}


byte ID = 10;
//VirtualWire lib
#include <VirtualWire.h>
int txPin = 3; //ueber Pin 3 die Daten senden
//digital Output
int out1 = 12;

//DHT lib
int dhtPin = 4;
#include "DHT.h"
DHT dht;

//Pausen zwischen den Messungen in Millisekunden
unsigned long stime = 1800000; // Zeit zwischen den Sendezeiten
unsigned long mtime = 900000; // Zeit zwischen den Messungen

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

