   VFinal = scaleVoltage((float)VRaw/sleep);
   IFinal = scaleCurrent((float)IRaw/sleep);
 
+  // dump to serial
+  dumpToSerial();
+
   // send data to remote host
   sendData();
-
-  // dump to serial
-  dumpToSerial();
 
   // profiling
   delta = abs(millis() - started);

  // listen on port
  server.listenOnLocalhost();
  server.begin();
}

void loop() {

  // Make sure that update period is not too high
  // when pushing data to Xively (one sample every 
  // 5 seconds should be a reasonable lower boud)

YunServer server;

void setup() {
  // Set serial port
  Serial.begin(115200); 
  // Use the led 13 to notify that the
  // setup completed
  pinMode(13,OUTPUT);
  digitalWrite(13, HIGH);
  // Init bridge library
  Bridge.begin();
  // Default on
  pinMode(RELAYPIN,OUTPUT);
  digitalWrite(RELAYPIN, LOW);
