Good evening.
I wish I could use the data (numeric only) that I send from an external device and are displayed in the output node of the TCP input to control a fader.
Is there a way?
Thanks, Alberto
Moderator: Moderator Group
/*
* Ethernet shield attached to pins 10, 11, 12, 13
created 06 Gen 2011
by Alberto Cauzzi
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x08, 0xE6 };
byte ip[] = { 192,168,1,182 };
byte server[] = { 192,168,1,181 }; // Pandora's box
// Initialize the Ethernet client library
// with the IP address and port of the server
Client client(server, 8084);
void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect()) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
int valoreA= analogRead(1);
delay(125);
client.print(valoreA);
Serial.println(valoreA);
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
}
Return to Widget Designer V4.7
Users browsing this forum: No registered users and 3 guests