 
 void setup() {
   Serial.begin(9600);
-  
+
   pinMode(GP2ReadPin, INPUT);
   pinMode(GP2LedPin, OUTPUT);
-  
+
   pinMode(TP4pin, INPUT);
-  
+
   pinMode(PPDpin, INPUT);
-  
+
   dht.begin();
-  
-  Serial.println("# Warm up...");
-  
-  out += "# GPdust, TPaq, PPDdust, humidity, temp";
-  
+
+  out = "# Starting... ";
+  out += FIRMWARE_VERSION;
+
   Serial.println(out);
-    time0 = micros();
+
+  out = "# GPdust, TPaq, PPDdust, humidity, temp";
+
+  Serial.println(out);
+  time0 = micros();
 }
 
 void loop() {
 
   i++;
-  
+
   // GP2Y10 dust sensor
   digitalWrite(GP2LedPin, LOW); // power on the LED
   delayMicroseconds(GPdelayTime1);

#define GPoffTime 9680
unsigned long GP2sum = 0;

#define TP4pin A1         // A1
unsigned long TP4sum = 0;

#define PPDpin 8          // D8
#define PPDsample 30e6   // us
unsigned long PPDsum = 0; // us

  delayMicroseconds(GPdelayTime2);
  digitalWrite(GP2LedPin, HIGH); // turn the LED off
  delayMicroseconds(GPoffTime);

  // DHT22 (AM2302) temperature & humidity sensor
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  // TP401A air quality sensor
  TP4sum += analogRead(TP4pin);

  // PPD42NS dust sensor
  PPDsum += pulseIn(PPDpin, LOW);

  if ( (micros() - time0) > PPDsample) {
    out = "";
    out += String(GP2sum / i);
    out += ",";
    out += String(TP4sum / i);
    out += ",";
    out += String(100 * PPDsum / (float)PPDsample);
    out += ",";
    out += String(h);
    out += ",";
    out += String(t);

    Serial.println(out);

    GP2sum = TP4sum = PPDsum = i = 0;

    time0 = micros();
  }

}
