 {
   Serial.println("loop");
   // Read pressure as mBar and temperature
-  float pressure = bmp.readPressure()/100;
-  float temperature = bmp.readTemperature();
-
+  float pressure = sensor.readPressure()/100;
+  float temperature = sensor.readTemperature();
+  #ifdef BME280
+    float humidity = sensor.readHumidity();
+  #endif
+  
   #ifdef BATTERY_SENSE_PIN
     // Read voltage
     int sensorValue = analogRead(BATTERY_SENSE_PIN);    // Battery monitoring reading
     float volt  = sensorValue * VBAT_PER_BITS;
     int batteryPcnt = sensorValue / 10;
-  
   #endif
   
   // Debug Output
   #ifdef MY_DEBUG
     Serial.print("Temperature = "); Serial.print(temperature); Serial.println(" *C");
     Serial.print("Pressure = "); Serial.print(pressure); Serial.println(" hPa");
+    #ifdef BME280
+      Serial.print("Humidity = "); Serial.print(humidity); Serial.println(" %");
+    #endif
     #ifdef BATTERY_SENSE_PIN
       Serial.print("A0 analogRead = "); Serial.println(sensorValue);
       Serial.print("Battery Voltage= "); Serial.print(volt); Serial.println(" V");

  #endif

  // Send values to gateway
  send(tempMsg.set(temperature, 1));
  send(pressureMsg.set(pressure, 2));
  #ifdef BATTERY_SENSE_PIN
    send(voltMsg.set(volt, 2));
    sendBatteryLevel(batteryPcnt);
  #endif
  sleep(SLEEP_TIME);
}



   REVISION HISTORY
   Version 1.0 - Henrik Ekblad
   Version 1.1 - Alex Muthmann - https://dev-eth0.de
   Version 1.2 - Alex Muthmann - https://dev-eth0.de

   DESCRIPTION
   Temperature and Pressure Sensor using Bosch's BMP280. It uses the Adafruit Library and provides both Temperature and current Pressure in seperate readings.

   NOTE
   If you want to run your Arduino with batteries, you should disable the brownout using an ISP:
   bin\avrdude.exe -Cetc\avrdude.conf -v -patmega328p -cstk500v1 -PCOM9 -b19200 -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0xff:m
*/


