]> git.piffa.net Git - arduino/blob - books/ArduinoNextSteps-master/ArduinoNextSteps/sketch_12_01_dhcp/sketch_12_01_dhcp.ino
first commit
[arduino] / books / ArduinoNextSteps-master / ArduinoNextSteps / sketch_12_01_dhcp / sketch_12_01_dhcp.ino
1 // sketch_12_01_dhcp
2
3 #include <SPI.h>
4 #include <Ethernet.h>
5
6
7 byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
8
9 void setup() 
10 {
11   Serial.begin(9600);
12   while (!Serial){};
13
14   if (Ethernet.begin(mac)) 
15   {
16     Serial.println(Ethernet.localIP());
17   }
18   else
19   {
20     Serial.println("Could not connect to network");
21   }
22 }
23
24 void loop() 
25 {
26 }
27
28