is it possible to connect Arduino Ethernet Shield direct to PC and send a String variable? How can I read it later on the PC?
Will this code work?
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 }; // Shield MAC
byte pc[] = "192.168.0.13"; // pc IP
EthernetClient client;
void setup()
{
Ethernet.begin(mac);
Serial.begin(9600);
Serial.println("connecting...");
delay(5000);
if (client.connect(server, 80)) {
Serial.println("connected");
client.println("Sample String");
client.println();
} else {
Serial.println("connection failed");
}
}
void loop()
{
}