Go Down

Topic: accessing SD files (Read 464 times) previous topic - next topic


Feb 16, 2019, 10:52 pm Last Edit: Feb 21, 2019, 11:28 pm by Nicshep
This problem is fixed now

I got a MKR ZERO to play audio files off an sd card and when I upload the code it reads the card just fine after I changed the chipSelect to SDCARD_SS_PIN. my problem is that when I use this code at the end of the setup

if(SD.exists("test.wav")) {
}else {
Serial.println("not there");

not there always shows up even though this showed up a line above it

Files found on the card (name, date and size in bytes):

SYSTEM~1/ 2019-02-15 16:31:38

WPSETT~1.DAT 2019-02-15 16:31:38 12

INDEXE~1 2019-02-15 16:31:42 76

TEST.WAV 2019-02-14 19:44:22 1748958

so I know that the file should exist. I have tried putting "test.wav" as "TEST.wav" and the not there message still shows up. Am I using the wrong code for a MKR or am I doing something very wrong? I have looked all over the internet and can't find any fixes for it. Any suggestion will help.


You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.


I fixed this problem by using the SdFat library rather than using SD library.

Go Up