toblum / McLighting

The ESP8266 based multi-client lighting gadget
MIT License
1.05k stars 289 forks source link

'DynamicJsonDocument' was not declared in this scope #472

Closed JHershey69 closed 4 years ago

JHershey69 commented 4 years ago

Using 6.14.1 and associated assistant for parsing program. Attempting to parse from http.get() but compiler doesn't like this code:

if (httpCode > 0) { Serial.println("Connection to Dark Sky sucessful!"); const size_t capacity = 686; DynamicJsonDocument doc(capacity);

deserializeJson(doc, http.getString());

float latitude = doc["latitude"]; // 37.8267
float longitude = doc["longitude"]; // -122.4233
const char* timezone = doc["timezone"]; // "America/Los_Angeles"

..... more code after but error happening at DynamicJsonDocument line

JHershey69 commented 4 years ago

Worked it out. Works great once I actually include the library. :)