forked from bblanchon/ArduinoJson
Minor changes
This commit is contained in:
@ -11,17 +11,16 @@ void setup()
|
|||||||
{
|
{
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
JsonHashTable<3> json;
|
JsonArray<2> array;
|
||||||
|
|
||||||
json.add("sensor", "gps");
|
|
||||||
json.add("time", 1351824120);
|
|
||||||
|
|
||||||
JsonArray<3> array;
|
|
||||||
array.add(48.756080, 6);
|
array.add(48.756080, 6);
|
||||||
array.add(2.302038, 6);
|
array.add(2.302038, 6);
|
||||||
json.add("data", array);
|
|
||||||
|
|
||||||
Serial.print(json); // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
|
JsonHashTable<3> root;
|
||||||
|
root.add("sensor", "gps");
|
||||||
|
root.add("time", 1351824120);
|
||||||
|
root.add("data", array);
|
||||||
|
|
||||||
|
Serial.print(root); // {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
Reference in New Issue
Block a user