Go Down

Topic: autodetect ethernet shield (Read 2 times) previous topic - next topic

kyngston

I'm building a sous-vide shield, and I would like to support both ethernet and serial.  However I need to use 9 digital outputs, so I must choose either ethernet, or serial, but cannot support both simultaneously.

I'd like to add a multiplexor, such that if I detect an ethernet shield, I use pins 0 and 1 as digital outputs.  If I don't detect a ethernet shield, I use pins 4 and 10 instead.  I know I could do this with board jumpers, but why not just autodetect the shield.

Any ideas on how to autodetect an ethernet shield to control my mux?

fungus

Why don't you use the analog pins? They work as digital, too.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

kyngston

uh, wow that's a much better solution.  I feel pretty dumb for assuming the analog pins were input only.
Thanks!

kyngston

Ok, so I freed up pins 0 and 1, by moving pins to to A1 and A2.

However it turns out, I still need to autodetect the ethernet shield.

in my void setup(), if I call
networked = 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?


fungus


in my void setup(), if I call
networked = 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...

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up