   //init DHT device
   dht.begin();
   sensor_t sensor;
-  Serial.println(F("setup ende"));
+  //Serial.println(F("setup ende"));
 }
 
 unsigned long task1, task2 = 0;
 void loop() {
   unsigned long currmillis = millis();
-  
+
   // Wenn die Zeit (worktime) kleiner als die Vergangene Zeit ist, Sende eine Nachricht.
   if ((unsigned long)(currmillis - task1) >= stime || (currmillis == 1000)) {
-    Serial.println(F("check DHT22"));
-    //send_msg("Testnachricht_1");
-    compute_msg(get_temp(), get_hum());
+    //Serial.println(F("check DHT22"));
+    TransmitData(get_temp(), get_hum());
     task1 = millis();
   }
 
   // checke die Luftfeuchtigkeit und wenn zu niedrig schalte Luefter ein.
   if ((unsigned long)(currmillis - task2) >= mtime) {
-    Serial.println(F("check if hum"));
+    //Serial.println(F("check if hum"));
     if ((float)(get_hum() <= 65.0 || get_hum() <= 75.0)) {
       // switch ventilator on
-      Serial.println(F("switch Ventilator on"));
+      //Serial.println(F("switch Ventilator on"));
       if (!fan1) {
         //oeffne Luefter schlitz
         int i = 1;
         //bitSet(reg, i);
         updateShiftRegister(i);
-        delay(60);
+        delay(15);
         //switch fan1 on
         i = 14;
         bitSet(reg, i);
         updateShiftRegister(i);
-        delay(60);
+        delay(20);
         fan1 = true;
       }
     } else {
       if (fan1) {
-        Serial.println(F("Switch Ventilator off"));
+        //Serial.println(F("Switch Ventilator off"));
         // switch fan1 off und schliesse den Schlitz
         reg = 0;
         updateShiftRegister(0);

#undef float
#undef round

int txPin = 3; //ueber Pin 3 die Daten senden

//attiny85 shiftregister
/*
#define latchPin PB2
#define clockPin PB0
#define dataPin PB1
int dhtPin = PB4; //DHT11 Pin
*/
//arduino shiftregister
#define latchPin 9 //PL

    }
    task2 = millis();
  }

}

void updateShiftRegister(int i) {
  /*
  Serial.print(F("REG = "));
  Serial.println(i);
  Serial.println(F("use shiftregister"));
  */
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, i);
  digitalWrite(latchPin, HIGH);
}

float get_temp() {
  // Read temperature as Celsius (the default)
  sensors_event_t event;
  dht.temperature().getEvent(&event);
  //Serial.print(F("Temperature in C = "));
  //Serial.println(event.temperature);
  return event.temperature;
}

float get_hum() {
  // Read humidity
  sensors_event_t event;
  dht.humidity().getEvent(&event);
  //Serial.print(F("Humidity in % = "));
  //Serial.println(event.relative_humidity);
  return event.relative_humidity;
}

void TransmitData(float temp, float hum) {
  /*
   * Erstelle eine Datenstruktur und
   * sende es danach mit einer simplen 
   * Pruefsumme an den Empfaenger
   * 
  */
  struct wData_STRUCT {
    byte identity;
    float s1;
    float s2;
    int checksum;
  };
  //Serial.println((temp * 100));
  //Serial.println((hum * 100));

  //Defines structure wData as a variable (retaining structure);
  wData_STRUCT wData;

  //Fill in the data.
  wData.identity = 90;
  wData.s1 = (temp * 100);
  wData.s2 = (hum * 100);
  wData.checksum = ((temp * 100) + (hum * 100)); //erstelle eine Pruefsumme mit den 2 Werten

  //Sende die Daten zur Sicherheit 3x
  //Serial.println(F("sending data"));
  vw_send((uint8_t *)&wData, sizeof(wData));
  vw_wait_tx();
  delay(20);
}

