diff --git a/examples/examples-custom-boards/lyrat-mini/sd/sd.ino b/examples/examples-custom-boards/lyrat-mini/sd/sd.ino index 01cbda006..c847c29b0 100644 --- a/examples/examples-custom-boards/lyrat-mini/sd/sd.ino +++ b/examples/examples-custom-boards/lyrat-mini/sd/sd.ino @@ -27,24 +27,27 @@ void setup(void) { // setup SPI SPI.begin(PIN_SD_CARD_CLK, PIN_SD_CARD_MISO, PIN_SD_CARD_MOSI, PIN_SD_CARD_CS); - // Determin if there is an SD card + // Optionally determine if there is an SD card pinMode(PIN_SD_CARD_DET, INPUT); if (digitalRead(PIN_SD_CARD_DET)!=0){ Serial.println("No SD Card detected"); } - // Setup SD and open file + // Open SD library if (!SD.begin(PIN_SD_CARD_CS)){ Serial.println("SD.begin failed"); while(true); } + // Open an existing file auto file = SD.open("/audio8000.raw", FILE_READ); if (!file){ Serial.println("file open failed"); while(true); } + file.close(); + Serial.println("Success"); } diff --git a/examples/examples-custom-boards/lyrat-mini/sdmmc/sdmmc.ino b/examples/examples-custom-boards/lyrat-mini/sdmmc/sdmmc.ino index c3b8ad170..4b1901019 100644 --- a/examples/examples-custom-boards/lyrat-mini/sdmmc/sdmmc.ino +++ b/examples/examples-custom-boards/lyrat-mini/sdmmc/sdmmc.ino @@ -24,7 +24,7 @@ void setup(void) { pinMode(PIN_SD_CARD_POWER, OUTPUT); digitalWrite(PIN_SD_CARD_POWER, LOW); - // Optionally: Determin if there is an SD card + // Optionally: Determine if there is an SD card pinMode(PIN_SD_CARD_DET, INPUT); if (digitalRead(PIN_SD_CARD_DET)!=0){ Serial.println("No SD Card detected"); @@ -36,12 +36,15 @@ void setup(void) { while(true); } + // open an existing file auto file = SD_MMC.open("/test.mp3", FILE_READ); if (!file){ Serial.println("file open failed"); while(true); } + file.close(); + Serial.println("Success"); }