How to get the library’s version?
ArduinoJson comes with the four following macros:
#define ARDUINOJSON_VERSION "7.3.0"
#define ARDUINOJSON_VERSION_MAJOR 7
#define ARDUINOJSON_VERSION_MINOR 3
#define ARDUINOJSON_VERSION_REVISION 0
Here is how you can print ArduinoJson’s version:
Serial.print("Using ArduinoJson version ");
Serial.println(ARDUINOJSON_VERSION); // 7.3.0
Here is how you can test that the expected version is installed:
#if ARDUINOJSON_VERSION_MAJOR!=7 || ARDUINOJSON_VERSION_MINOR<3
#error ArduinoJson 7.3+ is required
#endif