Also for the libraries to work pin D10 will have to be set as an output in the 'setup()' section of your sketch. "
This should not be required for the SparkFun shield unless you have a second SPI device.
Please run this program to get more info.
#include <SD.h>
#include <SPI.h>
Sd2Card card;
SdVolume vol;
SdFile root;
// Chip select pin for SD card.
const int sdCsPin = 8;
// Replace the -1 with the CS pin number of any shared SPI device.
const int sharedCsPin = -1;
void setup() {
Serial.begin(9600);
// Disable any other SPI devices
if (sharedCsPin >= 0) {
pinMode(sharedCsPin, OUTPUT);
digitalWrite(sharedCsPin, HIGH);
}
// Try to initialize the SD card
if (card.init(SPI_HALF_SPEED, sdCsPin)) {
Serial.println("card init OK");
} else {
Serial.print("errorCode: ");
Serial.println(card.errorCode(), HEX);
Serial.print("errorData: ");
Serial.println(card.errorData(), HEX);
return;
}
// Try to initialize the FAT volume.
if (vol.init(&card)) {
Serial.println("vol init OK");
} else {
Serial.println("vol init failed");
return;
}
// Try to open root
if (root.openRoot(&vol)) {
Serial.println("open root OK");
} else {
Serial.println("open root failed");
}
}
void loop() {}
If all is well you should see this:
card init OK
vol init OK
open root OK
If there is a hardware problem with the shield or card you will see something like this:
errorCode: 1
errorData: FF
If the card format is bad you will see something like this:
card init OK
vol init failed
Or this:
card init OK
vol init OK
open root failed
Please post the results.