I have an led connected to Pin 1. Right now i have the number on the website set to 0, for some reason my if statement is not working.
could you tell me what im doing wrong?
Note: i removed the correct domain name, there is no html or code or anything its just a 0.
I have tried all the different pins and different values, I have also removed the ethernet shild from the arduino ethernet shild and hooked up only pins 10, 11, 12, 13 on the digital side, and ground,3.3, 5v and all the icsp pins. I left all the other pins open and un-hooked and hooked up the led to the arduino using one of the open pins but did not seam to work.
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address for your controller below.
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
char serverName[] = "www.mydomainname.com";
String location = "/arduino/display.php";
// Initialize the Ethernet client library
EthernetClient client;
void setup() {
// start the serial library:
Serial.begin(9600);
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
// 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(serverName, 80)) {
//~~~~~// Serial.println("connected");
// Make a HTTP request:
client.println("GET http://www.donavonscreativeinnovations.com/arduino/display.php");
client.println();
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
// Serial.print(c);
if ((c) >= 1)
{
Serial.print("You Have New App Request! # Of Request:");
Serial.print(c);
digitalWrite(2, HIGH);
}
else
{
Serial.print("You Have No Request :");
digitalWrite(2, LOW);
}
}
// if the server's disconnected, stop the client:
//if (!client.connected()) {
// Serial.println();
//~~~~~// Serial.println("disconnecting.");
// client.stop();
// do nothing forevermore:
// while(true);
delay(1000);
// }
}