⚠️ CAUTION: SLIPPERY FLOOR ⚠️The Arduino Library Manager installs the ArduinoJson version 6 by default.
However, using version 5 is highly recommended because version 6 is still in beta stage.
Open the Arduino Library Manager and make sure that ArduinoJson version 5.13.4 is installed.
There are two ways to serialize a
- either set the value to
- or set the value to
For example, to generate the following JSON:
you can write:
DynamicJsonBuffer jsonBuffer; JsonObject& root = jsonBuffer.createObject(); root["myValue"] = (char*)0; // or (char*)NULL if you prefer root.printTo(Serial);