Hello Guys,
I have a problem assigning IP Address to my Arduino Ethernet Shield W5100. The IP Address keep showing 255.255.255.255. I actually have tried to disable the SD Card using the code that I found from most forum, I still can not assign IP Address. Would there be a problem with my Arduino Shield W5100, how would I know if there is? Please help.
I use the standard code from this website below with additional disable SD function:
#include <SPI.h>
#include <Ethernet.h>
// network configuration. dns server, gateway and subnet are optional.
// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// the dns server ip
IPAddress dnServer(192, 168, 100, 1);
// the router's gateway address:
IPAddress gateway(192, 168, 100, 1);
// the subnet:
IPAddress subnet(255, 255, 255, 0);
//the IP address is dependent on your network
IPAddress ip(192, 168, 100, 16);
void setup() {
// Disable SD
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
Serial.begin(9600);
// initialize the ethernet device
Ethernet.begin(mac, ip, dnServer, gateway, subnet);
//print out the IP address
Serial.print("IP = ");
Serial.println(Ethernet.localIP());
}
void loop() {
}