HowTo-Color (8) / Hacking Electronics / Simon Monk / 236-3 / Chapter 6
132
Hacking Electronics
Software
Figure 6-27 Selecting an IP address to use
This sketch is one of the most complicated in the book. However, it is one that can easily be used as a template for other hacks using an Arduino as a web server. Let’s break this sketch down and look at it a section at a time. // web_relay #include <SPI.h> #include <Ethernet.h> // MAC address just has to be unique. This should work byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // The IP address will be dependent on your local network:
06-ch06.indd 132
1/2/13 11:56 AM