This code works on an Arduino Due with an Arduino Ethernet shield and micro SD card:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,9);void setup()
{pinMode(10, OUTPUT);
digitalWrite(10,LOW);// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection and the server:Ethernet.begin(mac, ip);
server.begin();Serial.print("server is at ");
Serial.println(Ethernet.localIP());if (!SD.begin(4))
Serial.println("SD initialization failed.");
}
Note the digitalWrite(10, LOW).