ARDUINOJSON_USE_LONG_LONG
ARDUINOJSON_USE_LONG_LONG
determines the type used to store integer values in JsonVariant
.
- If
ARDUINOJSON_USE_LONG_LONG == 0
, thenJsonVariant
stores along
- If
ARDUINOJSON_USE_LONG_LONG == 1
, thenJsonVariant
stores along long
The default is 0
when ARDUINO
is defined, 1
otherwise.
In other words, it’s long
on embedded systems, but long long
on computers.
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>
Several
.ino
or.cpp
files?Be careful if several compilation units compose your program, i.e., if your project contains several
.ino
or.cpp
files.You should define the same value of
ARDUINOJSON_USE_LONG_LONG
in each compilation unit; otherwise, the executable will be much bigger because it will contain two variants of the library.