cleaned ethernet comments

jd-update
Flavien Haas 6 years ago
parent e9dbd16495
commit f2d5dd519f

@ -2,34 +2,28 @@
#include <Ethernet.h>
#include <SD.h>
//#define Serial SerialUSB
// MAC address from Ethernet shield sticker under board
byte mac[] = { 0xFE, 0xFD, 0xBE, 0xEF, 0xFF, 0xFD };
IPAddress ip(192, 168, 1, 50); // IP address, may need to change depending on network
EthernetServer server(80); // create a server at port 80
File webFile;
File webFile; // var webfile de type File
void setup()
{
Serial.begin(9600); // for debugging
Ethernet.begin(mac, ip); // initialize Ethernet device
Serial.println("hello");
Ethernet.begin(mac); // initialize Ethernet device
server.begin(); // start to listen for clients
Serial.print("server is at "); // display on serial the IP you can find the webpage
Serial.println(Ethernet.localIP());
SerialUSB.print("server is at "); // display on serial the IP you can find the webpage
SerialUSB.println(Ethernet.localIP());
// initialize SD card
Serial.println("Initializing SD card...");
if (!SD.begin(4)) {
if (!SD.begin(4)) { // initialize SD card
Serial.println("ERROR - SD card initialization failed!");
return; // init failed
}
Serial.println("SUCCESS - SD card initialized.");
// check for index.htm file
if (!SD.exists("index.htm")) {
if (!SD.exists("index.htm")) { // check for index.htm file
Serial.println("ERROR - Can't find index.htm file!");
return; // can't find index file
}

Loading…
Cancel
Save