File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
examples/examples-custom-boards/lyrat-mini Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -27,24 +27,27 @@ void setup(void) {
2727 // setup SPI
2828 SPI.begin (PIN_SD_CARD_CLK, PIN_SD_CARD_MISO, PIN_SD_CARD_MOSI, PIN_SD_CARD_CS);
2929
30- // Determin if there is an SD card
30+ // Optionally determine if there is an SD card
3131 pinMode (PIN_SD_CARD_DET, INPUT);
3232 if (digitalRead (PIN_SD_CARD_DET)!=0 ){
3333 Serial.println (" No SD Card detected" );
3434 }
3535
36- // Setup SD and open file
36+ // Open SD library
3737 if (!SD.begin (PIN_SD_CARD_CS)){
3838 Serial.println (" SD.begin failed" );
3939 while (true );
4040 }
4141
42+ // Open an existing file
4243 auto file = SD.open (" /audio8000.raw" , FILE_READ);
4344 if (!file){
4445 Serial.println (" file open failed" );
4546 while (true );
4647 }
4748
49+ file.close ();
50+
4851 Serial.println (" Success" );
4952}
5053
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ void setup(void) {
2424 pinMode (PIN_SD_CARD_POWER, OUTPUT);
2525 digitalWrite (PIN_SD_CARD_POWER, LOW);
2626
27- // Optionally: Determin if there is an SD card
27+ // Optionally: Determine if there is an SD card
2828 pinMode (PIN_SD_CARD_DET, INPUT);
2929 if (digitalRead (PIN_SD_CARD_DET)!=0 ){
3030 Serial.println (" No SD Card detected" );
@@ -36,12 +36,15 @@ void setup(void) {
3636 while (true );
3737 }
3838
39+ // open an existing file
3940 auto file = SD_MMC.open (" /test.mp3" , FILE_READ);
4041 if (!file){
4142 Serial.println (" file open failed" );
4243 while (true );
4344 }
4445
46+ file.close ();
47+
4548 Serial.println (" Success" );
4649}
4750
You can’t perform that action at this time.
0 commit comments