 {
   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");

   REVISION HISTORY
   Version 1.0 - Henrik Ekblad
   Version 1.1 - 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.
*/



//////////////////////////////////////////////////////
//#define MY_DEBUG // Enable debug prints to serial monitor


#define BME280; // Enable if you are using a BME280 instead of BMP280

// disable this if you don't want to measure the voltage
//#define BATTERY_SENSE_PIN A0  // select the input pin for the battery sense point
//#define SEND_VOLTAGE; // Enable if you want to send the voltage explicit
#define VMIN 1.9  // Battery Level 0%
#define VMAX 3.3  // Batter Level 100%
#define VBAT_PER_BITS 0.003363075  // Volts per bit on the A0 pin. For 470k and 1M Ohm @ 3.3V
