Hi there,
I'm working on a school project and now I have to test Arduino Ethernet Connection using a local site in XAMPP. As there's no DHCP involved I have to assign a fixed IP-adress to Arduino. How do I have to do that.
My example code is:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char serverName[] = "search.google.com";
EthernetClient client;
int result;
void setup ()
{
Serial.begin(9600);
if(Ethernet.begin(mac) ==0)
{Serial.println("DHCP-Konfiguration fehlgeschlagen");
while(true)
;
}
delay(1000);
Serial.println("Verbindung wird hergestellt...");
}
void loop()
{
if(client.connect(serverName, 80)>0)
{
Serial.println("Die Verbindung wurde erfolgreich hergestellt.");
client.println("GET /search?q=600+km+in+Meilen HTTP/1.0");
client.println();
}
else
{Serial.println("That's an error. That's all we know.");
}
if(client.connected())
{if(client.find("="))
{result = client.parseInt();
Serial.print("600 km sind" );
Serial.print(result);
Serial.println(" Meilen");
}
}
else
Serial.println("Kein Ergebnis gefunden");
client.stop();
delay(1000);
}
It would be great if someone could tell me where I have to implement those settings - or even better if someone could do that for me.
Thanks in advance.
Yours
Dominik