ArduinoJson 5.12.0 * Added `JsonVariant::operator|` to return a default value * Added a clear error message when compiled as C instead of C++ (issue #629) * Added detection of MPLAB XC compiler (issue #629) * Added detection of Keil ARM Compiler (issue #629) * Added an example that shows how to save and load a configuration file * Reworked all other examples
5.11.2
Changes since- Added
JsonVariant::operator|
to return a default value (see below) - Added a clear error message when compiled as C instead of C++ (issue #629)
- Added detection of MPLAB XC compiler (issue #629)
- Added detection of Keil ARM Compiler (issue #629)
- Added an example that shows how to save and load a configuration file
- Reworked all other examples
How to use the new feature?
If you have a block like this:
const char* ssid = root["ssid"]; if (!ssid) ssid = "default ssid";
You can simplify like that:
const char* ssid = root["ssid"] | "default ssid";
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.12.0.h
put it in your project folder - Download
ArduinoJson-v5.12.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v5.12.0.h
are ArduinoJson-v5.12.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.