Page 1 of 1

LCD w/Buttons and Ethernet Shield

Posted: Fri Mar 08, 2019 3:40 pm
by madmacks
Purchased the RB-Fee-10 LCD shield because it isn't supposed to conflict with pin 10 for backlight and it should work fine with the Arduino Ethernet Shield 2. But, I'm not able to get them working together.

If I just stack them together on my Arduino Mega they work independently (i.e. LCD sketch is fine, or Ethernet sketch is fine), but when I combine the two working sketches I get nothing or garbage on the LCD and no button responses. I understand that D4 could be causing problems as it's used on the LCD shield and also as SD card SS on the ethernet shield, so I changed the LiquidCrystal definition to use A4 rather than D4 (and set A4 as OUTPUT and HIGH). Didn't work...

So, as a control, and as I'm using a Mega, I unplugged the LCD shield and wired it up with jumper wires to 5V, Gnd, A0, D3-D9 but plugged the other end of the D4 wire into D22 on the Mega, and then used 22 in the LiquidCrystal set up statement. This worked fine and I maintained a solid ethernet connection (writing to MySQL DB) and also received LCD responses to inputs from the buttons and saw displayed messages that I expected.

So, a question...

Why wouldn't the plugged in LCD shield (on top of the ethernet shield) work by remapping D4 to A4 in the LiquidCrystal set up statement and using it as a digital pin so as not to create a possible SD card SS on the ethernet board? As I understand thing (obviously badly) this should work fine. Is D4 hard wired on the LCD in a way that doesn't allow remapping to A4? I can bend the D4 pin over and wire it to D22 but that kind of defeats the purpose of using the shield.

Help would be appreciated, and if I can provide more info I'd be happy too.

Re: LCD w/Buttons and Ethernet Shield

Posted: Fri Mar 08, 2019 11:22 pm
by madmacks
So, I just cut off pin D4 about half way down on the LCD shield, stripped a bit of the insulator off the remaining D4 pin stub and then soldered in a wire connection from the A4 pin over to what was left of the D4 pin. Problem solved the old fashion way via hardware fix. Then I updated the LiquidCrystal definition to use A4 rather that D4. If someone has a better approach using software let me know.