 
 void setup()
 {
-  Serial.begin(9600);  
-  
-  // if (!startSD())
-  // {
-  //   return;
-  // }
-  
-  // logToFile(FILENAME, counter);  
-  // readFileToSerial(FILENAME);
-
+  Serial.begin(9600);
+  setSyncProvider(RTC.get); // get time from Real Time Clock
+  if(timeStatus()!= timeSet)
+    Serial.println("Unable to sync with the RTC");
+  else
+    Serial.println("RTC has set the system time");
+
+  // Set button to write to file
   attachInterrupt(0, buttonInterrupt, RISING);
+
+  // Set call to update files every minute
+  Alarm.timerRepeat(10, recordData);
 }
 
 void loop()
 {
   if (buttonPressed)
   {
-    doButtonCall();
-  }
-}
-
-
+    recordData();
+  }
+
+  Alarm.delay(1000); // Check every second
+}
+
+

    int tempA = thermistorA.getReading();
    int tempB = thermistorB.getReading();

    logToFile(FILENAME, tempA);
    logToFile(FILENAME, tempB);
    readFileToSerial(FILENAME);
  }
  buttonPressed = false;


  buttonPressed = true;
}

// Read and record data to log files
void recordData()
{
  delay(250);
  Serial.println("Woo");
