I am new to Arduino shields. The problem I have is I want to use W5100 Ethernet shield AND LCD 1602 Module at the same time with Arduino Uno.
When I upload the code, if both the shields are attached then they will not work. Only if one of them is attached, that shield will work.
I avoided duplicated pin usage between the shields (i.e. I understand that W5100 uses pins 10,11,12,13 and the LCD uses pins 4 to 9 then 10 for BL which I changed it to 3). but still I am facing the same problem.
Hewnikel:
Correct. I noticed it as well. maybe if I cut the pin and solder it to pin 3 it might work? any suggestions??
Yeah, you'd need to do something like that - probably cut the pin on the side that it plugs in, then solder a jumper along the top of the shield.
Or just get an LCD that isn't a shield - you can get 1602 display with the I2C backpack on it (so it only needs the A4 and A5 pins for I2C to control it via LiquidCrystal_I2C library) for under $3 on ebay... This is the problem with the shields - while they're designed to be stackable, in practice the hardwired pins frequently conflict with eachother, and many shields have no way to change the pin assignments.
You don't actually describe either of the shields. I can only assume they are the typical W5100+SD shield, and LCD+keypad. In this instance, pin 4 is required by CS for SD. All you need do is clip pin 4 on LCD shield and solder a jumper across to a convenient pin, like A2, and edit your code accordingly. This is done using the holes on the shield provided. Do not be tempted to put the jumper on another shield, and do not be tempted to clip pins unnecessarily, which is usually the case. This is the only case I am actually aware of where it has been necessary to clip a pin on a shield.
Ask twice, cut once.
"maybe if I cut the pin and solder it to pin 3 it might work?"
Well, I would not cut the pin, but instead just carefully bend it flat out to the side. Get one of the small plastic pin jumpers and solder a wire to one side and slide the other jumper hole on to the end of the bent pin. Connect the other end of the wire to wherever it needs to go.
OK guys it worked! I just removed pin 10 from LCD module, and also changed the BL pin definition to another not-used pin (P.S. it didn't affect the Backlight :D).