+#include <Adafruit_Sensor.h>
 #include <Wire.h>
+#include <SPI.h>
+
+// SD card libraries
+#include <BlockDriver.h>
+//#include <FreeStack.h> // something is wrong with this library.
+#include <MinimumSerial.h>
+#include <SdFat.h>
+#include <SdFatConfig.h>
+#include <SysCall.h>
+
+// Sensor libraries.
+#include <Adafruit_BME280.h>
+#include <Adafruit_GPS.h>
+//#include <Adafruit_BNO055.h>
+#include <Adafruit_BME280.h>
 
 // RCR headers
 #include "Setupable.h"
 
+FILE file; // file manager
 SdFatSdio sd_card; // SD card manager
-File file; // file manager
+Adafruit_BME280 bme; // I2C connection to BME280
+
 
 // To shorten RCR namespace, use namespace alias "custom".
 namespace custom = rcr::level1payload;

    Serial.println("File could not be initialized."); 
  }
  else {
    file.println("I'm text in a file!");
    file.close(); // Close when finished.
  }
}

void printBmpData(void) {
  Serial.print("Temperature = ");
  Serial.print(bmp.temperature());
  Serial.println(" °C");

  Serial.print("Ambient pressure = ");
  Serial.print(bmp.ambient_pressure());
  Serial.println(" Pa");

  Serial.print("Pressure altitude = ");
  Serial.print(bmp.pressure_altitude());
  Serial.println(" meters");
  Serial.println();
}

bool written = false;

void loop() {
  printBmpData();
  if (!written) {
    write_to_sd();
    written = true;

  delay(512);

  // Setup objects and verify working condition.
  setup_objects();
  
  // Setup() the custom data structures.
  //for (custom::Setupable* obj : setupables) {
  //  obj->Setup();
  //}

  Serial.println();
  Serial.println("SETUP COMPLETE.");
