mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 10:17:39 +02:00
Added JsonGenerator example for Arduino
This commit is contained in:
30
examples/JsonGeneratorExample/JsonGeneratorExample.ino
Normal file
30
examples/JsonGeneratorExample/JsonGeneratorExample.ino
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Arduino JSON library
|
||||
* Benoit Blanchon 2014 - MIT License
|
||||
*/
|
||||
|
||||
#include <JsonGenerator.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
|
||||
JsonHashTable<3> h;
|
||||
|
||||
h.add("pi", 3.14);
|
||||
|
||||
JsonArray<3> a;
|
||||
a.add(1.0);
|
||||
a.add(2.0);
|
||||
a.add(3.0);
|
||||
h.add("list", a);
|
||||
|
||||
h.add("hellow", "world");
|
||||
|
||||
Serial.print(h);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user