Fixed example JsonConfigFile.ino for ESP8266

This commit is contained in:
Benoit Blanchon
2019-08-10 14:17:23 +02:00
parent 2ee655f9ba
commit 63d7d87080
2 changed files with 9 additions and 1 deletions

View File

@ -5,6 +5,7 @@ HEAD
---- ----
* Added `measureJson()` to the `ArduinoJson` namespace (PR #1069 by @nomis) * Added `measureJson()` to the `ArduinoJson` namespace (PR #1069 by @nomis)
* Fixed example `JsonConfigFile.ino` for ESP8266
v6.11.3 (2019-07-22) v6.11.3 (2019-07-22)
------- -------

View File

@ -11,6 +11,12 @@
// "port": 2731 // "port": 2731
// } // }
// //
// To run this program, you need an SD card connected to the SPI bus as follows:
// * MOSI <-> pin 11
// * MISO <-> pin 12
// * CLK <-> pin 13
// * CS <-> pin 4
//
// https://arduinojson.org/v6/example/config/ // https://arduinojson.org/v6/example/config/
#include <ArduinoJson.h> #include <ArduinoJson.h>
@ -111,7 +117,8 @@ void setup() {
while (!Serial) continue; while (!Serial) continue;
// Initialize SD library // Initialize SD library
while (!SD.begin()) { const int chipSelect = 4;
while (!SD.begin(chipSelect)) {
Serial.println(F("Failed to initialize SD library")); Serial.println(F("Failed to initialize SD library"));
delay(1000); delay(1000);
} }