Review Ethernet Shield com Wiznet W5100 / TF Slot

details

Review Ethernet Shield with Wiznet W5100 / TF Slot
The Ethernet Shield Wiznet W5100 uses the chip, which is reliable and its major competitor the Microchip ENC28J60. Good Ethernet Shield with Wiznet is having a well difuncida library in Arduino, moreover it works with all microcontrollers.

 

#include <SPI.h>

#include <Ethernet.h>

byte mac[]= {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // Aqui vc coloca seu MAC

byte ip[] =(192,168,0,120); // Aqui vc coloca um IP, varia de acordo com sua rede

EthernetServer server(80); // iniciando servidor na porta 80

void setup()

  {

Serial.begin(9600); // Abre comunicacao serial
Ethernet.begin(mac, ip); // define seu mac e IP
server.begin(); // inicia servidor
Serial.print(“server is at “); // imprime endereco IP na serial
Serial.println(Ethernet.localIP());
}

void loop()

{

EthernetClient client = server.available(); // procura clients conectados
if (client) {
Serial.println(“new client”);
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
if (== \n && currentLineIsBlank) {
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-Type: text/html”);
client.println(“Connnection: close”);
client.println();
client.println(“<!DOCTYPE HTML>”);
client.println(“<html>”);

          client.println (“<center>”);
           client.println (“<H1>DEALEXTREME ETHERNET</H1>”);
          client.println (“</center>”);

client.println(“</html>”);
break;
}
if (== \n) {
currentLineIsBlank = true;
}
else if (!= \r) {
currentLineIsBlank = false;
}
}
}
delay(1);
client.stop();
Serial.println(“client disonnected”);
}
}

 

URL : http://microembarcado.blogspot.kr/2012/09/review-ethernet-shield-com-wiznet-w5100.html

Authors : 

COMMENTS

Please Login to comment
  Subscribe  
Notify of