Using a Mega and a SD Card to Write, Read, Remove and List files and directories. This clip shows how to Make a File, Make a Directory, List a Directory, List a File, Change Directory, Remove a Directory, Write to a File, Read from a File and Open Multiple Files using an Arduino Mega and a Micro SD TF Card Memory Shield Module SPI Micro SD Adapter. I Open 20 files at the one time, write text to each and then save them to the micro SD card. I index the files using an array containing all 20 files. Also, I delete files and directories using variable names.
Included is the Fritzing schematic for wiring an Arduino Mega and a Micro SD TF Card Memory Shield Module SPI Micro SD Adapter that I purchased at Banggood.com. I describe and show how several of the SD library routines are coded and function. Lastly, I mention several suggestions to consider while coding your sketch.
NOTE: I failed to mention in the video clip the code that saves SRAM memory. it is:
Serial.println (F("Some text here."));
This was very handy by moving the text string from Mega SRAM (8K in size) to Mega main memory (325K in size). The Uno has even smaller SRAM! This coding is very simple to use.
Download the sketch here:
http://www.mediafire.com/file/qtxhdfq...