Ho provato a collegare Ethernet Shield Rev.3 con Arduino Uno Rev.3 e ho scritto un codice d'esempio questo:
#include <SPI.h>
#include <Ethernet.h>
// network configuration. gateway and subnet are optional.
// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x23, 0x1F };
//the IP address for the shield:
byte ip[] = { 192,168,1,4};
// the router's gateway address:
byte gateway[] = { 192, 168, 2, 1 };
// the subnet:
byte subnet[] = { 255, 255, 255, 0 };
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup()
{
// initialize the ethernet device
Ethernet.begin(mac, ip, gateway, subnet);
// start listening for clients
server.begin();
}
void loop()
{
// if an incoming client connects, there will be bytes available to read:
EthernetClient client = server.available();
if (client == true) {
// read bytes from the incoming client and write them back
// to any clients connected to the server:
server.write(client.read());
}
}
Ma non succede niente,che cosa devo fare? Il mio router è Belkin N Wireless Router F5D8236-4.Grazie.