   pinMode(CS_PIN, OUTPUT);
   Serial.begin(9600);
 
-  if (!SD.begin(CS_PIN)) {
+  if (!SD.begin(CS_PIN) and !bmp.begin()) {
     Serial.println(F("begin failed"));
     digitalWrite(rLed, HIGH);
     delay(2000);

      return;
    }
  }
  dataFfile = SD.open(fileName, FILE_WRITE);
  if (!dataFile) {
    // Blink 3 times faster
    Serial.println("open failed");

#include <SPI.h>
#include <SD.h>
#include <Wire.h>                  // BMP085
#include <Adafruit_BMP085.h>       // BMP085
// Base name must be six characters or less for short file names.
#define FILE_BASE_NAME "Data"

