 }
 
 
-void WriteDataToLogger(float Temperature, float Pressure, float Altitude, float Latitude, float Longitude) {
+void WriteDataToLogger(int TimeStamp, float Temperature, float Pressure, float Altitude, float Latitude, float Longitude) {
   if(!DataLogger.isListening()) { DataLogger.listen(); }
 
+  DataLogger.print(TimeStamp);
+  DataLogger.print(",");
   DataLogger.print(Temperature, 2);
   DataLogger.print(",");
   DataLogger.print(Pressure, 0);

  if(!HasGoodGPSReading) 
  {
    static int i = 0;
    if(!gpsSerial.isListening()) { gpsSerial.listen(); }
    if (gpsSerial.available())
    {
      char ch = gpsSerial.read();
  
      if(ch == '$') { i = 0; }
  
      if (ch != '\n' && i < sentenceSize)
      {
        sentence[i] = ch;
        i++;
      }
      else
      {
        sentence[i] = '\0';
        i = 0;
    
        char field[20];
        getField(field, 0);
        if(strcmp(field, "$GPRMC") == 0)
        {
          getField(field, 3);
          CurrentLatitude = atof(field);
          getField(field, 5);
          CurrentLongitude = atof(field);
          
          HasGoodGPSReading = true;
        }




void PrintToSerialOutput(int TimeStamp, float Temperature, float Pressure, float Altitude, float Latitude, float Longitude) {

  // We print each component of the data line using separate calls instead of using something like sprintf to
  // format a single string.  This is done because the version of sprintf available to us for the Arduino does
  // not support floats.  This was the simplest Plan B we could come up with.
  
  Serial.print(TimeStamp);
  Serial.print(",");
  Serial.print(Temperature, 2);
  Serial.print(",");
  Serial.print(Pressure, 0);
