     Serial.println("-----");  
   } 
 }
+
+void setTravelTime() {
+    while (Serial.available() == 0) { }
+    
+    int input = Serial.parseInt();
+    travelTime = input;
+}
+
+void readDHT11() {
+    int chk = DHT11.read();
+    switch (chk) {
+        case 0: Serial.println("OK"); break;
+        case -1: Serial.println("Checksum error"); break;
+        case -2: Serial.println("Time out error"); break;
+        default: Serial.println("Unknown error"); break;
+     }
+    
+//      Serial.print("Humidity (%): ");
+//      Serial.println((int) DHT11.humidity, DEC);
+      myrec.humidity = (int) DHT11.humidity;
+    
+//      Serial.print("Temperature (°C): ");
+//      Serial.println((double) DHT11.temperature, DEC);
+      myrec.temperature = (double) DHT11.temperature;
+    
+      db.append(DB_REC myrec);
+}

     
     if (msg == "viewData") selectAll();
     else if (msg == "stopLogging") logData = false;
   }
  
   unsigned long currentMillis = millis();

   if(currentMillis - previousMillis >= logInterval && logData) {
      previousMillis = currentMillis;
      
      readDHT11();
   }
  //selectAll();
}
