   buttonPressed = true;
 }
 
-void doButtonCall()
+// Read and record data to log files
+void recordData()
 {
   delay(250);
   Serial.println("Woo");

  }
}

boolean startSD()
{
  Serial.print("Initializing SD card...");


void setup()
{
  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)
  {
    recordData();
  }

  Alarm.delay(1000); // Check every second
}


