Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(SD.exists(jsonFileName)){
- Serial.println("++Config file");
- DynamicJsonDocument jsonData(JSONMAXCAPACITY) ;
- jsonFile = SD.open(jsonFileName,FILE_READ);
- if(!jsonFile)
- {
- Serial.println("Can't read conf file.");
- }
- /* while (jsonFile.available()) {
- Serial.write(jsonFile.read());
- }*/
- deserializeJson(jsonData, jsonFile);
- auto error = deserializeJson(jsonData, jsonFile);
- if (error) {
- Serial.print(F("deserializeJson() failed with code "));
- Serial.println(error.c_str());
- return;
- }
- const char* value = jsonData["name"];
- Serial.println(value);
- jsonFile.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement