Hi, i´m tryng to compile this example code but arduino give me some errors.
the code is here
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = {0x90,0xA2,0xDA,0x0D,0x00,0xCF};
byte ip[] = {192,168,1,11};
EthernetServer server(80);
int PinLed = 2;
String readString = String(30);
void setup()
{
Ethernet.begin(mac, ip);
pinMode(PinLed,OUTPUT);
Serial.begin(9600);
}
void loop()
{
EthernetClient client = server.available();
if(client)
{
while (client.connected())
{
if(client.available())
{
char c = client.read();
if(readString.length()<30)
{
readString += c;
Serial.print(c);
}
if(c=='\n')
{
if(readString.trim() ==("GET /?Led=On HTTP/1.1")) //line 38
{
digitalWrite(PinLed,HIGH);
}
if(readString.trim()==("GET /?Led=Off HTTP/1.1")) //line 42
{
digitalWrite(PinLed,LOW);
}
readString="";
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<html>");
client.println("<head>");
client.println("<title>Encendido led</title>"); //line 55
client.println("</head">);
client.println("<body>");
client.println("<h1>encendido led por intenrnet</h1>");
client.println("<form method=get>");
client.println("<input type=submit name=Led value=On>");
client.println("<input type=submit name=Led value=Off>");
client.println("</form>");
client.println("</body>");
client.println("</html>");
client.stop();
}
}
}
}
}
and this is the error log
ethernet_ejemplo.cpp: In function 'void loop()':
ethernet_ejemplo:37: error: void value not ignored as it ought to be
ethernet_ejemplo:41: error: void value not ignored as it ought to be
ethernet_ejemplo:55: error: expected primary-expression before ')' token
can anybody explain me the errors? thanks a lot