You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having trouble listing pre-recorded songs from SD card using Audio Shield Board. Songs can be played fine, but would like to list them on ILI9341 LCD screen. I found the following code for listing files from the SD documentation of functions, but it always returns empty. Wondering if this is even the correct code to use with the Audio Shield Board. Does anyone know if this works? If not, any recommendations?
void printDirectory(File dir, int numTabs) {
while (true) {
File entry = dir.openNextFile();
if (! entry) {
// no more files
Serial.print("No more files, last entry = "); Serial.println(numTabs);
break;
}
for (uint8_t i = 0; i < numTabs; i++) {
Serial.print('\t');
}
Serial.print(entry.name());
if (entry.isDirectory()) {
Serial.println("/");
printDirectory(entry, numTabs + 1);
} else {
// files have sizes, directories do not
Serial.print("\t\t");
Serial.println(entry.size(), DEC);
}
entry.close();
}
Hardware & Software
Board Teensy 3.2
Audio Shield Board
Arduino IDE version 1.8.5
Teensyduino version 1.42
The text was updated successfully, but these errors were encountered:
Please ask in the forum, here is is wrong place for questions, and this has nothing to do with the audio library - its the SD library. Then, please post the complete code in the forum.
Having trouble listing pre-recorded songs from SD card using Audio Shield Board. Songs can be played fine, but would like to list them on ILI9341 LCD screen. I found the following code for listing files from the SD documentation of functions, but it always returns empty. Wondering if this is even the correct code to use with the Audio Shield Board. Does anyone know if this works? If not, any recommendations?
This part is in setup:
root = SD.open("/");
printDirectory(root, 0);
Serial.println("done!");
This is the subroutine:
void printDirectory(File dir, int numTabs) {
while (true) {
}
Hardware & Software
Board Teensy 3.2
Audio Shield Board
Arduino IDE version 1.8.5
Teensyduino version 1.42
The text was updated successfully, but these errors were encountered: