Re: Interperting data with WebSocketServer
Posted: Fri Feb 12, 2016 7:40 pm
Ok, I decided that anything worth doing is worth doing right, so I went ahead and took your advice martinayotte and went with JSON. It works amazingly. Now I can send all sorts of data. Here is the code.
Thank you for your recommendation.
Code: Select all
StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject((char *)payload);
Serial.print("X = ");
Serial.println((int)root["x"]);
Serial.print("Y = ");
Serial.println((int)root["y"]);
Thank you for your recommendation.