 ISR(WDT_vect) { Sleepy::watchdogEvent(); }
 
 
-#define DEBUG 1
+#define DEBUG 0
 #define NOOP 0
 
 // DHT22 Power wire is plugged into jeenode DI03 (arduino: digital 6)

  delay(2);
}

// send payload and optionally report on serial port
static void doReport() {
#if !NOOP
    // power up RF
    rf12_sleep(RF12_WAKEUP);

    // send payload
    rf12_sendNow(0, &payload, sizeof payload);
    rf12_sendWait(RADIO_SYNC_MODE);

    // power down RF
    rf12_sleep(RF12_SLEEP);
#endif

#if DEBUG
    Serial.print("[thlNode] ");
    Serial.print((int) payload.light);
    Serial.print(' ');
    Serial.print((int) payload.lobat);
    Serial.print(' ');
    Serial.print((int) payload.humi);
    Serial.print(' ');
    Serial.print((int) payload.temp);
    Serial.println();
    serialFlush();
#endif
}


  // report
  doReport();

  // sleep
  for (byte i = 0; i < REPORT_PERIOD; ++i) {
    // max value is 60 seconds
    Sleepy::loseSomeTime(60000);
  }
}

