Created
February 23, 2020 06:59
-
-
Save rosmianto/607ab771ad3c6816cb7692312dac1a4f to your computer and use it in GitHub Desktop.
How to List SD Card directory content Arduino Platform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Serial.println("List dir"); | |
File root = SD.open("/"); | |
File file = root.openNextFile(); | |
while (file) { | |
Serial.print("FILE: "); | |
Serial.println(file.name()); | |
file = root.openNextFile(); | |
} | |
Serial.println("opening..."); | |
File f = SD.open("/test.wav", "r"); | |
if (!f) { | |
Serial.println("file open failed!"); | |
} | |
else { | |
Serial.println("file open OK!"); | |
f.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment