   if (lx == 0 && broadband > 65000){ //Sensor appears to be in direct sunlight outside it's resolution limits. Set lx value to max to simplify downstream logic
       lx = 0xFFFF;
   }
-  Serial.print("'AmbientLight':"); printValue(lx);
-  Serial.print("'BroadbandLight':"); printValue((long)broadband);
-  Serial.print("'Infrared':"); printValue((long)infrared);
+  Serial.print("\"AmbientLight\":"); printValue(lx);
+  Serial.print("\"BroadbandLight\":"); printValue((long)broadband);
+  Serial.print("\"Infrared\":"); printValue((long)infrared, 0);
 
   Serial.println("}}");
   

    }
    return 0;
}
/*
    Wake up the XBEE from sleep. 
    For hibernation periods longer than 10sec, or so, XBee will have to re-join the PAN. 
    Use ATMY command to confirm that the node got its network address before attempting to send data to DH/DL 
*/
/*
int wakeUpXbee(void){
    while(getCh() != NULL) ;       //Drain any pending messages on the serial.
    
    Serial.print("+++");
    delay(500);
    if (getCh()=='O' && getCh()=='K'){
        for(int j=0; j<5; j++){
          Serial.println("ATMY");
          if (!(getCh()=='F' && getCh()=='F' && getCh()=='F' & getCh()=='E')){
             Serial.println("ATCN");  //Got non-FFFE address. Exit command mode immediately.
             return 1;
          }
          delay(1000);
        }
    }
  return 0;
}
*/

char getCh(){
  if (Serial.available()){

}

void printValue(long value){
  printValue(value, 1);
}

void printValue(long value, short separator){
  if (!isnan(value))
  {
    Serial.print(value); 
  }
  else
  {
    Serial.print("'NaN'");
  }
  
  if (separator){
    Serial.print(", ");
  }
}

