ArduinoJson comes with the four following macros:

#define ARDUINOJSON_VERSION ""
#define ARDUINOJSON_VERSION_MAJOR 
#define ARDUINOJSON_VERSION_MINOR 
#define ARDUINOJSON_VERSION_REVISION 

Here is how you can print ArduinoJson’s version:

Serial.print("Using ArduinoJson version ");
Serial.println(ARDUINOJSON_VERSION);  // 

Here is how you can test that the expected version is installed:

#if ARDUINOJSON_VERSION_MAJOR!= || ARDUINOJSON_VERSION_MINOR<
#error ArduinoJson .+ is required
#endif

See also: