/*
* ENC28J60/W5100 Ethernet Module example.
*/
#include <UIPEthernet.h> //
https://github.com/UIPEthernet/UIPEthernet
//#include <SPI.h>
//#include <Ethernet.h>
EthernetClient client;
void setup() {
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
Serial.begin(9600);
int ret = Ethernet.begin(mac);
Serial.println("ret =" + String(ret));
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);
Serial.print("-");
}
Serial.println("");
}
void loop() {
}
|