If you plan on using the ethernet shield, do not use digital pins 10-13 for other devices. You are using digital pin 12, and that is one of the SPI data lines used by the w5100.
If you plan on using the ethernet shield, do not use digital pins 10-13 for other devices. You are using digital pin 12, and that is one of the SPI data lines used by the w5100.