Show Posts
Pages: [1]
1  Using Arduino / Storage / Delete files on SD card on: October 14, 2012, 06:55:30 pm
Hi,

I am trying to right a function that clears all files on the SD card. This is my function. It doesnt do anything. help me please!

void clearSDcard()
{
  char filname = root.openNextFile();
  if(SD.exists(&filname))
  {
    SD.remove(&filname);//returns filename
    Serial.println("File removed");
  }
  Serial.println("All files deleted from card");
}
Pages: [1]