 /*
 Temperature Monitoring system
 
- The circuit:
- * SD card attached to SPI bus as follows:
- ** MOSI - pin 11
- ** MISO - pin 12
- ** CLK - pin 13
- ** CS - pin 4
-
-  filename has to be short :\ *NOTE*
-
- */
+The circuit:
+* SD card attached to SPI bus as follows:
+** MOSI - pin 11
+** MISO - pin 12
+** CLK - pin 13
+** CS - pin 4
+
+filename has to be short :\ *NOTE*
+
+*/
 #include <SD.h> // Modified SD.cpp in SD library to allow for multiple SD.begin() calls
 // Add to Line 343 of SD.cpp: 'if (root.isOpen()) {root.close();}'
+
+#include <Time.h>
+#include <TimeAlarms.h>
+#include <Wire.h>
+#include <DS1307RTC.h>
 
 #include <ThermistorSensor.h>
 

  buttonPressed = true;
}

void doButtonCall()
{
  delay(250);
  Serial.println("Woo");

  }
}

// Log time to file
void logTimeToFile(char* filename)
{
  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open(filename, FILE_WRITE);
  
  // if the file opened okay, write to it:
  if (myFile) {
    // Serial info
    Serial.print("Writing '");
    Serial.print(month());
    Serial.print(" ");
    Serial.print(day());
    Serial.print(" ");
    Serial.print(hour());
    Serial.print(" ");
    Serial.print(minute());
    Serial.print("' to ");
    Serial.print(filename);
    Serial.print("... ");
    
    // Write value to file and close
    myFile.print(month());
    myFile.print(" ");
    myFile.print(day());
    myFile.print(" ");
    myFile.print(hour());
    myFile.print(" ");
    myFile.print(minute());
    myFile.close();
    
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening for writing.");
  }
}

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