I've some problems with my Arduino duemilanove and the WiFly shield from sparkfun. This is my code:
#include "WiFly.h"
WiFlyClient client("***********", 15000);
char passphrase[] = "usibigbrother";
char ssid[] = "USI_BIG_BROTHER";
void setup() {
Serial.begin(9600);
delay(100);
Serial.println("connecting...");
WiFly.begin();
if (!WiFly.join(ssid, passphrase,8)) {
Serial.println("Association failed.");
while (1) {
// Hang on failure.
}
}
}
void loop() {
Serial.println("Start of void loop");
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
Serial.println("End of void loop");
}
When i start it the PI04 pin turns on and starts to blink with a green light, after one or two seconds the PI06 becomes yellow and blink for 3 times; in the meanwhile the PI05 becomes red and starts to blink some times and then it turns off.
I don't understand where the problem is. I wanna to create a Client in order to connect to a Server and take the data from it. I'm using the last version of Arduino IDE. Thank you in advance.