Using the SD card

The first thing that we are going to do in this project is to test whether we can actually access the SD card. This will ensure that we don't run into SD card-related problems later in the project.

This is a picture of the Ethernet Shield that I used, with the microSD card mounted on the right:

Using the SD card

Let's now see the code that we will use to test the SD card's functionalities. The following is the complete code for this section:

// Include the SD library #include <SPI.h> #include <SD.h> // Set up variables using the SD utility library functions: Sd2Card card; SdVolume volume; SdFile root; // change this to match your SD shield or module; ...

Get Arduino: Building exciting LED based projects and espionage devices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.