Last active
August 29, 2015 14:03
-
-
Save bblanchon/f51f90794c93408d545c to your computer and use it in GitHub Desktop.
Size of types of the Arduino JSON library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoJson.h> | |
using namespace ArduinoJson; | |
#define PRINT_VALUE(X) {Serial.print(#X" =\t");Serial.println(X);} | |
#define PRINT_SIZE(X) {Serial.print("sizeof("#X") =\t");Serial.println(sizeof(X));} | |
void setup() | |
{ | |
Serial.begin(9600); | |
PRINT_SIZE(JsonVariant); | |
PRINT_SIZE(StaticJsonBuffer<10>); | |
PRINT_SIZE(StaticJsonBuffer<20>); | |
PRINT_VALUE(JSON_ARRAY_SIZE(0)); | |
PRINT_VALUE(JSON_ARRAY_SIZE(1)); | |
PRINT_VALUE(JSON_ARRAY_SIZE(2)); | |
PRINT_VALUE(JSON_OBJECT_SIZE(0)); | |
PRINT_VALUE(JSON_OBJECT_SIZE(1)); | |
PRINT_VALUE(JSON_OBJECT_SIZE(2)); | |
} | |
void loop() | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment