I'm new here, but i've a problem with the SD library (arduino 1.0.1., Mega 2560 +SD on Ethernet shield):
I want to dump the directory of an sd card as often as a user want's.
The following code e.g. work's for fine for a few (depends on how much entries exist) loops. Then less directory entries are found, at last even none !
Can anyone help ?
#include <SD.h>
void setup() {
Serial.begin(9600);
SD.begin(4);
}
void loop() {
File root = SD.open("/");
File entry = root.openNextFile();
while(entry) {
Serial.println(entry.name());
entry = root.openNextFile();
}
root.close();
Serial.println();
delay(1000);
}