⚠️ 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.
A variable that can hold different type of values:
- a boolean
- a char, short, int or a long (signed or unsigned)
- a string (const char*)
- a reference to a JsonArray or JsonObject
JsonVariant can be any of theses types at a time, but can only hold one value.
Its type can change at run time.
The book Mastering ArduinoJson is the best material to learn how to use ArduinoJson.
Chapter 5 explains how ArduinoJson works from the inside.
For example, it dissects the class
JsonVariant and explains how it works.
Chapter 7 presents new sample project and explains how they work.
For example, the project “Recursive Analyzer” extracts the content of a
JsonVariant recursively, i.e., it retrieves the content of all its children.