in my void setup(), if I callnetworked = Ethernet.begin(mac);it takes a long time for DHCP to give up, and the code moves on to the next line.Is there a fast way to check for the shield?
I don't think the Ethernet library supports DCHP...
ReturnsThe DHCP version of this function, Ethernet.begin(mac), returns an int: 1 on a successful DHCP connection, 0 on failure. The other versions don't return anything.
IPAddress ip(192,168,0,2);Ethernet.begin(mac, ip);if(Ethernet.localIP() == ip) Serial.println("shield present");else Serial.println("no shield");
If you are going to all that trouble, then assign a static ip and read it.
Quote from: fungus on Feb 13, 2013, 10:44 amI don't think the Ethernet library supports DCHP...I don't know how recent it is, but v1.0 now supports DHCP, and it works very well for me:http://arduino.cc/en/Reference/EthernetBegin
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16