 
 void updateTemperatures()
 {
-  tempA = thermistorA.getReading();
-  tempB = thermistorB.getReading();
+  // tempA = thermistorA.getReading();
+  // tempB = thermistorB.getReading();
+  tempA = thermistorA.getFilteredReading();
+  tempB = thermistorB.getFilteredReading();
 }
 
 // Read and record data to log files
 void recordData()
 {
-  delay(250);
+  Alarm.delay(250);
   Serial.println("Woo");
   if (startSD())
   {
+    SDCardExists = true;
     // Read thermistors
     updateTemperatures();
 

    Serial.println("T_out.txt: ");
    readFileToSerial("T_out.txt");
  }
  trigger_button = false;

}

boolean trigger_lcd = false;

// void updateLCD()
// {
//   sprintf(lcd_line_buffer, "%2d/%02d %02d:%02d:%02d", 
//     month(), day(), hour(), minute(), second());
//   // lcd.clear();
//   lcd.setCursor(0,0);
//   lcd.print(lcd_line_buffer);

//   sprintf(lcd_line_buffer, "IN: %2d, OUT: %3d", 
//     tempA, tempB);
//   lcd.setCursor(0,1);
//   lcd.print(lcd_line_buffer);

//   // LCD refreshed, clear update bit
//   trigger_lcd = false;
// }


void triggerLCD()

  // 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();
}

