   Serial.begin(115200);
   Serial.println("Altimeter v1.0 - Equipe Rocket 2017");
   
-  barometer.settings.commInterface = I2C_MODE;
-  barometer.settings.I2CAddress = 0x76;
-  barometer.settings.runMode = 3;
-  barometer.settings.tStandby = 0;
-  barometer.settings.filter = 4;
-  barometer.settings.tempOverSample = 5;
-  barometer.settings.pressOverSample = 5;
-  barometer.settings.humidOverSample = 1;
-  delay(50);
-  barometer.begin();
-  delay(50);
+  if (!bmp.begin()) {  
+    Serial.println("Could not find a valid BMP280 sensor, check wiring!");
+    while (1);
+  }
 
   Wire.begin();
 

#define SAMPLING 1                  // Samples Per Second.

// DON'T TOUCH IN THE CODE BELOW
BME280 barometer;

float altReference = -900;
uint32_t entriesCounter = 0;


    updateEntriesCount(entriesCounter);

    delay(960/SAMPLING);
  }
}
