 unsigned long age;
 int gps_year;
 byte gps_month, gps_day, gps_hour, gps_minute, gps_second;
-bool haveClock=false;
+unsigned long gps_start;
 
 // **************** FOR SD CARD ******************
 #define CHIP_SELECT_PIN 10

  pinMode(SHARP_LED_PIN, OUTPUT);

  // **************** FOR GROVE SENSOR ****************
  pinMode(8, INPUT);
  pinMode(13, OUTPUT);
  grove_start_time=millis();

  // **************** FOR MQ7 SENSOR ****************
  pinMode(CO_PWR_SEL_PIN, OUTPUT);
  digitalWrite(CO_PWR_SEL_PIN, LOW);// 5v phase
  heaterInHighPhase = true;
  CO_timer_start = millis();
  CO_switch_time = CO_timer_start + CO_HEAT_TIME;

  
  // filename will be mm-dd-hh.txt
  DateTime rtc_time=rtc.now();
  file_name = String( rtc_time.month() ) + '-' + String( rtc_time.day() ) + '@' + 
      String( rtc_time.hour() ) + ".txt";
#ifndef DEBUG
  SD.begin(CHIP_SELECT_PIN);
  delay(100); // otherwise open() will fail

  // write header
  data_file = SD.open(file_name.c_str(), FILE_WRITE);
  if (data_file) {
    data_file.print("Rec. #\tMM/DD/YYYY\tHH:MM:SS (UTC)\tlatitude\tlongitude\t");
    data_file.println("Sharp\tGrove\tCO read\tCO heat\tHumidity\tTemp (celsius)");
    data_file.close();
  }
#endif

} // setup

