   return true;
 }
 
-boolean trigger_button = false;
+boolean trigger_logging = false;
 void buttonInterrupt()
 {
-  trigger_button = true;
+  trigger_logging = true;
 }
 
 void updateTemperatures()

  else
    Serial.println("RTC has set the system time");

  updateTemperatures();

  // Set button to write to file
  attachInterrupt(0, buttonInterrupt, RISING);

  // Set call to update files every minute
  Alarm.timerRepeat(60, buttonInterrupt);

  // Update LCD screenevery second
  Alarm.timerRepeat(1, triggerLCD);

  // Done
  lcd.setCursor(0,1);
  lcd.print("Initialized.");
  Alarm.delay(500);
  lcd.clear();
}

void loop()
{
  // Called like this to avoid SPI bus collision between SD & LCD
  if (trigger_button)
  {
    Serial.println("Trigger Button");
    recordData();
    Alarm.delay(250);
    lcd.clear();
    if (SDCardExists)
      lcd.print("Data Logged");
    else
      lcd.print("No SD Card");
    Alarm.delay(500);

    trigger_button = false;
  }

  if (trigger_lcd)
  {
    // Serial.println("Trigger LCD");
    updateTemperatures();
    updateLCD();
    Alarm.delay(10);

    trigger_lcd = false;
  }

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



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