When working with an Arduino Ethernet Shield v5 and using, for example, the
eventlog sketch included in the download the call to sd.init() returns a card
init error = 1
This error results from the Arduino shield sharing the SPI bus b/n the ethernet
chip and sd card. It uses pin 4 as the CS pin for the SD card. Modifying the
call to sd.init as below allows the code to work.
Replace this block -
// Initialize SdFat - print detailed message for failure
if (!sd.init()) sd.initErrorHalt();
With this -
// Initialize SdFat - print detailed message for failure
pinMode(10, OUTPUT); // set the SS pin as an output
digitalWrite(10, HIGH);
if (!sd.init(SPI_FULL_SPEED,4)) sd.initErrorHalt();
I expect this will work with the other examples too
Original issue reported on code.google.com by daviespg...@gmail.com on 10 Apr 2011 at 3:50
Original issue reported on code.google.com by
daviespg...@gmail.com
on 10 Apr 2011 at 3:50