Non ne vuole sapere di inserirmi i dati nemmeno cosi eppure dovrebbe essere ok!
avete qualche idea?
#include <Ethernet.h>
#include <SPI.h>
int sensorPin = A0; // select the input pin for the potentiometer
int sensorPin2 = A1; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
int sensorValue2 = 0;
char buffer[1800];
int time;
int newLineCount;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 177 };
byte server[] = { 192, 168, 1, 185 };
Client client(server, 80);
void setup()
{
Serial.begin(9600);
delay(1000);
}
void loop()
{
if (client.connected()==false) {
// wait a second so as not to send massive amounts of data
Ethernet.begin(mac, ip);
client.connect();
sensorValue = analogRead(sensorPin);
delay(1000);
sensorValue2 = analogRead(sensorPin2);
delay(1000);
sprintf(buffer, "GET /arduino/connet.php?codice=98738&val1=%d&val2=%d HTTP/1.0",sensorValue ,sensorValue2);
client.println(buffer);
}
if (client.connect()==true) {
newLineCount = 0;
while( newLineCount != 2 )
{
if( client.available() )
{
char ch = client.read();
if( ch == '\n' )
{
newLineCount++;
}
else if( newLineCount != 0 )
{
newLineCount--;
}
}
}
client.stop();
}
}