CAUTION: SLIPPERY FLOORThe 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 is installed.
Gets the current size (i.e. the number of bytes used) of the
This should not be confused with the capacity of the
JsonBuffer, which is the total number of bytes that the buffer can hold.
size_t size() const;
The size (ie the number of bytes used) of the
StaticJsonBuffer<200> jsonBuffer; Serial.println(jsonBuffer.size()); jsonBuffer.createObject(); Serial.println(jsonBuffer.size()); jsonBuffer.createArray(); Serial.println(jsonBuffer.size());
would print this on an 8-bit AVR:
0 4 8