 // **************** RTC ****************
 RTC_DS1307 rtc;
 bool haveRTC=false; // if we have time info from gps
-
+DateTime now;
 
 // **************** timer for sensor data collection ****************
 unsigned long sensors_read_time_start;

#endif

  // **************** SENSOR READING STAMP TIME ****************
  DateTime now = rtc.now();

  // **************** FOR SHARP SENSOR ****************
  digitalWrite(SHARP_LED_PIN, LOW); // power on the LED


  // **************** FOR GROVE SENSOR ****************
  ratio = lowpulseoccupancy / (grove_sample_time*10.0);  // Integer percentage 0=>100
  // using spec sheet curve
  concentration = 1.1*pow(ratio, 3) - 3.8*pow(ratio, 2) + 520 * ratio + 0.62;
  lowpulseoccupancy = 0;  // reset


  // **************** FOR MQ7 SENSOR ****************
  
    if (millis() > CO_switch_time) {  // switch to 1.4V phase
      if (heaterInHighPhase) { 
        digitalWrite(CO_PWR_SEL_PIN, HIGH); // 1.4v phase
        heaterInHighPhase = false;
        CO_switch_time = millis() + CO_READ_TIME;
      } else { // switch to 5V phase
        digitalWrite(CO_PWR_SEL_PIN, LOW);// 5v phase
        heaterInHighPhase = true;
        CO_switch_time = millis() + CO_HEAT_TIME;
      }
  }
  // readGasLevel
  gasLevel = analogRead(CO_READ_PIN);
 // if (heaterInHighPhase)
 //   gasLevel = 0xFFFF;

  
  // **************** FOR TEMP & HUMIDITY SENSOR ****************
  // Reading can take 200 milliseconds, can only be done every 2 seconds
  float h = dht.readHumidity();
  float f = dht.readTemperature(false); // change to true for Farenheit
  if (isnan(h) || isnan(f)) { // Check if any reads failed and set to error value.
    h=255;    f=255;
  }
