Hello,
I'm new in this forum. I'm hading a hard time getting the SD card to work.
I have Arduino Mega 2560 and a standard Ethernet+SD Shield.
My SD card is a Sandisk SDHC 8GB, formatted as FAT16 with one primary 2GB partition. I used windows DISKPART to do that.
I have also tried this same SD card formated in factory defaults (FAT32 + 8GB partition). Also tried a different SD card as well.
My shield looks like this:
As I have two identical shields, I tried to replace the shield, and the same error ocurred.
My code:
#include <SD.h>
#include <SPI.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,4,5,6,7);
void setup() {
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
if (!SD.begin(4)) {
lcd.println("Error reading SD!");
}
else{
lcd.print("SD OK!");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
It always fails in SD.begin, and shows the message "Error reading SD!"
I have read dozens of forum posts, tried many things, with no success. :o
Any ideas?
Thanks!!