void setup() {
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
Serial.begin(9600);
#if defined WIZ550io_WITH_MACADDRESS
if (!Ethernet.begin() ) {
#else
if (!Ethernet.begin(mac) ) {
#endif
Serial.println("Ethetnet begin fail");
while(1) {}
}
Serial.print("localIP: ");
Serial.println(Ethernet.localIP());
Serial.print("subnetMask: ");
Serial.println(Ethernet.subnetMask());
Serial.print("gatewayIP: ");
Serial.println(Ethernet.gatewayIP());
Serial.print("dnsServerIP: ");
Serial.println(Ethernet.dnsServerIP());
for (byte thisByte = 0; thisByte < 4;
thisByte++) {
// print the value of each byte of the
IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
if (thisByte != 3) Serial.print("-");
}
Serial.println();
#if defined WIZ550io_WITH_MACADDRESS
uint8_t MACaddress[6]; // array for mac address
Ethernet.macAddress(MACaddress);
Serial.print("WIZ550io MAC Address is ");
for(int i = 0; i < 6; i++) {
if (MACaddress[i] < 0x10)
Serial.print("0");
Serial.print(MACaddress[i],HEX);
if (i != 5) Serial.print("-");
}
Serial.println("");
#endif
}
|