Skip to content
📟 JSON library for Arduino and embedded C++. Simple and efficient.
C++ CMake Other
Branch: 6.x
Clone or download

Latest commit

Latest commit 6fb52c3 May 15, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Configure the "lock-threads" app Jan 13, 2020
examples Changed the array subscript to automatically add missing elements Feb 20, 2020
extras Fixed publish script May 15, 2020
src Set version to 6.15.2 May 15, 2020
.clang-format Added a line-break after each "if" to get more accurate coverage report Feb 16, 2020
.gitattributes Fixed segmentation fault in `DynamicJsonBuffer` when memory allocatio… Aug 1, 2015
.gitignore Moved ancillary files to `extras/` (fixes #1011) Sep 3, 2019
.mbedignore Added fuzzing/ to .mbedignore Jan 25, 2017
.travis.yml Fixed "deprecated-copy" warning on GCC 9 (fixes #1184) Feb 13, 2020
ArduinoJson.h Updated copyright notice Jan 9, 2020
CHANGELOG.md Set version to 6.15.2 May 15, 2020
CMakeLists.txt CMake: gathered all build flags in a dedicated file Apr 28, 2020
CONTRIBUTING.md Split CONTRIBUTING and SUPPORT Oct 3, 2017
LICENSE.md Updated copyright year Feb 19, 2020
README.md Set version to 6.15.2 May 15, 2020
SUPPORT.md Added campaign information in links Jan 15, 2018
appveyor.yml Set version to 6.15.2 May 15, 2020
banner.svg Added banner with the new logo Oct 16, 2017
component.mk esp-idf make system Oct 7, 2019
keywords.txt Added measureJson, measureJsonPretty, and measureMsgPack to keywords Jan 13, 2020
library.json Set version to 6.15.2 May 15, 2020
library.properties Set version to 6.15.2 May 15, 2020

README.md

ArduinoJson


arduino-library-badge Build Status Build Status Fuzzing Status Coverage Status GitHub stars

ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).

Features

Quickstart

Deserialization

Here is a program that parses a JSON document with ArduinoJson.

char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";

DynamicJsonDocument doc(1024);
deserializeJson(doc, json);

const char* sensor = doc["sensor"];
long time          = doc["time"];
double latitude    = doc["data"][0];
double longitude   = doc["data"][1];

See the tutorial on arduinojson.org

Serialization

Here is a program that generates a JSON document with ArduinoJson:

DynamicJsonDocument doc(1024);

doc["sensor"] = "gps";
doc["time"]   = 1351824120;
doc["data"][0] = 48.756080;
doc["data"][1] = 2.302038;

serializeJson(doc, Serial);
// This prints:
// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}

See the tutorial on arduinojson.org

Support the project

Do you like this library? Please star this project on GitHub!

What? You don't like it but you love it?
We don't take donations anymore, but we sell a book, so you can help and learn at the same time.

You can’t perform that action at this time.