  Serial.print("{'status': 'OK'}\n");
 }
 
+void getRGBColor() {
+  
+  int red = 255 - analogRead(redPin);
+  int green = 255 - analogRead(greenPin);
+  int blue = 255 - analogRead(bluePin);
+  
+  Serial.print("{'status': 'OK'}");
+//  Serial.print("'color': '{'");
+//  Serial.print("'red': ");
+//  Serial.print(red);
+//  Serial.print(", 'green': ");
+//  Serial.print(green);
+//  Serial.print(", 'blue': ");
+//  Serial.print(blue);
+//  Serial.print("}}\n");
+  
+}
+
 int readCommand(char *command) {
     int bufferSize = 0;
     

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  //dht.begin();
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);

    int led;
    
    token = strtok(NULL, " ");
    
    if (strcmp(token, "state") == 0) {
      token = strtok(NULL, " ");
      led = atoi(token);
      int state = ledState(led);
      
      if (state == HIGH)
        Serial.print("{'status': 'OK', 'state': 'on'}\n");
      else
        Serial.print("{'status': 'OK', 'state': 'off'}\n");
        
      return;
    }
    
    led = atoi(token);
    toggleLed(led);
  }
  
  else if (strcmp(token, "temp") == 0) {
    readTemperature();
  }
  
}

void readTemperature() {
    
  int val = analogRead(tempPin);
  float cel = val*0.322265625;
        
  Serial.print("{'temperature': ");
  Serial.print(cel);
  Serial.print("}\n");
    
}

void toggleLed(int led) {
