   }
   Serial.print("Writing to "); 
   Serial.println(filename);
-  //logfile.println("Time, Date, Latitude, Longitude, Elevation, Speed (Knots), Angle, Satellites");
-  //logfile.flush();
+  // Print csv header
+  logfile.println("Time, Date, Latitude, Longitude, Elevation, Speed (Knots), Angle, Satellites, Color Temp, Lux, R, G, B, C");
+  logfile.flush();
 
   // connect to the GPS at the desired rate
   GPS.begin(9600);

Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS34725_INTEGRATIONTIME_700MS, TCS34725_GAIN_1X);

void setup() {
  // for Leonardos, if you want to debug SD issues, uncomment this line
  // to see serial output
  //while (!Serial);
  
  if (tcs.begin()) {
    Serial.println("Found sensor");
  } else {
    Serial.println("No TCS34725 found ... check your connections");
    while (1);
  }
  
  tcs.setInterrupt(true);

  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out

    logfile.print(",");
    logfile.print(GPS.angle);
    logfile.print(",");
    logfile.print((int)GPS.satellites);
    logfile.print(",");
    //Color
    logfile.print(colorTemp, DEC); 
    logfile.print(",");
    logfile.print(lux, DEC); 
    logfile.print(",");
    logfile.print(r, DEC); 
    logfile.print(",");
    logfile.print(g, DEC); 
    logfile.print(",");
    logfile.print(b, DEC); 
    logfile.print(",");
    logfile.println(c, DEC);
    // Wait for logging to finish
    logfile.flush();
    // Print to serial
    Serial.println("Logging: complete");
    Serial.println();
    Serial.println("Logged Data:");
    // Time
    Serial.print(GPS.hour, DEC);
    Serial.print(':');
    Serial.print(GPS.minute, DEC);
    Serial.print(':');
    Serial.print(GPS.seconds, DEC);
    Serial.print('.');
    Serial.print(GPS.milliseconds);
    Serial.print(",");
    // Date
    Serial.print(GPS.month, DEC); 
    Serial.print('/');
    Serial.print(GPS.day, DEC);
    Serial.print("/20");
    Serial.print(GPS.year, DEC);
    Serial.print(",");
    // Coordinates
    Serial.print(GPS.latitude, 4);
    Serial.print(GPS.lat);
    Serial.print(",");
    Serial.print(GPS.longitude, 4);
    Serial.print(GPS.lon);
    Serial.print(",");
    Serial.print(GPS.altitude);
    Serial.print(",");
    Serial.print(GPS.speed);
    Serial.print(",");
    Serial.print(GPS.angle);
    Serial.print(",");
    Serial.print((int)GPS.satellites);
    Serial.print(",");
    // Color temp
    Serial.print(colorTemp, DEC); 
    Serial.print(",");
    Serial.print(lux, DEC); 
    Serial.print(",");
    Serial.print(r, DEC); 
    Serial.print(",");
    Serial.print(g, DEC); 
    Serial.print(",");
    Serial.print(b, DEC); 
    Serial.print(",");
    Serial.println(c, DEC);

    Serial.print("\n");
    Serial.println();
  }
}

