ARDUINOJSON_USE_LONG_LONG
Description
ARDUINOJSON_USE_LONG_LONG determines the type used to store integer values in JsonVariant.
- If
ARDUINOJSON_USE_LONG_LONG == 0, thenJsonVariantstores along - If
ARDUINOJSON_USE_LONG_LONG == 1, thenJsonVariantstores along long
The default is 1 on 32-bit and 64-bit processors, 0 otherwise.
In other words, ArduinoJson uses long long when it doesn’t increases memory usage.
Setting it to 0 doesn’t reduce memory consumption but can slightly reduce code size.
The default value changed in ArduinoJson 6.19
Only 0 and 1 are valid. Any other value (like false or true) will produce a compilation error.
Several
.inoor.cppfiles?Be careful if several compilation units compose your program, i.e., if your project contains several
.inoor.cppfiles.You should define the same value of
ARDUINOJSON_USE_LONG_LONGin each compilation unit; otherwise, the executable will be much bigger because it will contain two variants of the library.
Example
To override the default value, you need to #define the value before including ArduinoJson.h, like this:
#define ARDUINOJSON_USE_LONG_LONG 1
#include <ArduinoJson.h>