 
 // A4 pin 1   -> +5V
 // A4 pin 2   -> GND
-// A4 pin 5   -> 7688 Duo pin D0
-// G3 pin 5   -> 7688 Duo pin D11
+// A4 pin 5   -> 7688 Duo pin D11
+// G3 pin 5   -> 7688 Duo pin D9
 // SHT-31 SDA -> 7688 Duo pin D2
 // SHT-31 SCL -> 7688 Duo pin D3
 // DHT-22 DAT -> 7688 Duo pin D4
 
+#include <stdarg.h>
 #include <Wire.h>
 #include <SoftwareSerial.h>
 #include <Adafruit_SHT31.h>
 #include <DHT.h>
 #include <AM2321.h>
 
+#define SERIAL_DEBUG  true  // Comment to disable it
+
 #define DHTTYPE DHT22
 #define DHTPIN  4
 #define G3PIN   8

DHT dht(DHTPIN, DHTTYPE);
AM2321 am2321;

void setup() {
  Serial.begin(9600);
  Serial1.begin(57600);
  g3.begin(9600);
  a4.begin(9600);
  dht.begin();
  if (!sht31.begin(0x44)) {
    Serial.println("Couldn't find SHT31");
  }
  delay(500);
}

  pm25 = -1;
  pm100 = -1;
  memset(buf, 0, 32);
  a4.listen();
  for(x = 0; x < 32;) {
    if(a4.available()) {
      data = a4.read();
