Ethernet shield led help!!!!

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);
 // }
}

I don’t see your pinMode in setup…

Put this inside setup()

pinMode(2,OUTPUT);

Preferable after your Serial.begin

Also, uncomment the line

// Serial.print(c);

And see if the value of ‘c’ ever gets greater than 0. You also have the same line in the ‘if’ satement. If ‘c’ never has a value greater than 1, you will never see that print statement. Take this completely out of your code.

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?

In the code, you have the LED connected to pin 2…

As soon as i get home i will try and add pinMode(2,OUTPUT); I will post the out come later thank you so much for the help.

As for removing // Serial.print(c); if you look in the if statement i have the Serial.print(c); I can see that in the values changing in the scerial monitor.

  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);
}

Than, the value of ‘c’ is becoming greater than 0.

So the problem is probably the pinMode. But, I think it would be better to take it out of the ‘if’ statement and uncomment the other one. That way, you will always know what value the ‘c’ is, even it’s 0.

No luck…HELP!!

the problem with that is i only want the led to turn on if its greater then 1 and off if its is 0 or less aka 0

codlink:
Than, the value of ‘c’ is becoming greater than 0.

So the problem is probably the pinMode. But, I think it would be better to take it out of the ‘if’ statement and uncomment the other one. That way, you will always know what value the ‘c’ is, even it’s 0.

Does any one have an idea? I am still having the problem and can not seam to figure out what is wrong?!!?!? :cry: