     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() {
-  
-  float t = dht.readTemperature(); //70.4;
-  float h = dht.readHumidity(); //23;
+    
+  int val = analogRead(tempPin);
+  float cel = val*0.322265625;
         
   Serial.print("{'temperature': ");
-  Serial.print(t);
-  Serial.print(", 'humidity': ");
-  Serial.print(h);
+  Serial.print(cel);
   Serial.print("}\n");
-  
+    
 }
 
 void toggleLed(int led) {

    // put your main code here, to run repeatedly:
    if (Serial.available()) {
        int i = readCommand(stringBuffer);
        tokenize(stringBuffer);
    }
    
}

void tokenize(char* stringBuffer) {
  char s[32];
  strcpy(s, stringBuffer);
  char* token = strtok(s, " ");

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