Page 1 of 1

LCD reallocation of pins?

Posted: Thu Aug 23, 2012 6:53 am
by Rol
Attempting a project which call for the LCD reallocation of pins.
They suggest changing these wires:
"So here is the LCD shield connection to Prototype Shield / Arduino."

D9----------------------------------Digital Pin 13
D8----------------------------------Digital Pin 12
D7----------------------------------Digtial Pin 7
D6----------------------------------Digital Pin 6
D5----------------------------------Digital Pin 5
D4----------------------------------Digital Pin 4
RESET----------------------------RESET
5v-----------------------------------5v
Gnd--------------------------------Gnd
A0----------------------------------A0

Also change sketch from " LiquidCrystal lcd(8, 9, 4, 5, 6, 7);" to "LiquidCrystal lcd(12, 13, 4, 5, 6, 7);"

The reason given is to save pwm pins for other uses in the project.
To-date have not been able to get any on screen using this method.
Perhaps there is another way to do this?
Any ideas Please.

Re: LCD reallocation of pins?

Posted: Sat Aug 25, 2012 5:34 am
by ngp99
I think we are in opposite ends of the same boat. I have an eBay 16x2 displ;ay and keypad. It wouldn't work with the kosher Arduino sketch. In a happy mixture of blunder and desperation, I tried the Freeronics tutorial sketch. It works. This sketch specifically mentions the keypad. The pin allocation line is
LiquidCrystal lcd(8,9,4,5,6,7);

The Arduino tutorial is for a bare device, not on a shield, and the pin allocation is

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

From this I conclude that the pins in the display are distributed differently when it is mounted on a shield, probably for convenience in the board design. You don't get a choice about this, and you just have to know what Arduino aren't telling you. If you are making your own shield, or using a breadboard, I guess you can use what pins you like, and it is just a matter of knowing which pin does what. It seems that the Arduino tutorial reveals all, but it is just for a bare display.

Re: LCD reallocation of pins?

Posted: Sat Aug 25, 2012 7:26 am
by Rol
Hi ngp99,
Thanks for your reply.
Finding it a steep learning curve starting Arduino.
I really have to do the tutorial programs.
Trying to run before I can walk.
After a couple of days eventually found the wire change was from project board
to LCD & not vice verse.
Also thought of about bending the board extender pins out ( 90 degrees) where you don't want them to connect.
Then it would be a simple job to bridge the pins with short jumpers to reallocate wire numbers etc. Less of a "bird's nest" effect with the wiring.
Cheers

Re: LCD reallocation of pins?

Posted: Sat Aug 25, 2012 9:00 am
by ngp99
Hi Rol
Me too, and I have to admit that the progress I am making is as much due to good luck as good management.
My LCD display is probably under control but I can only get one button to work.

I'm not quite sure what you are doing but, if you want to take pins out of play, it might be safer to use stackable headers and bend the pins in them.

Re: LCD reallocation of pins?

Posted: Sun Aug 26, 2012 10:11 am
by Rol
Hi ngp99,

Have you tried the LCD sketch on this page
http://www.freetronics.com/pages/16x2-l ... DnyRaN-rLI

The project I'm attempting is at https://sites.google.com/site/caddnima/sandbox
I like you idea using the stackable headers with the pins bent.

Re: LCD reallocation of pins?

Posted: Sun Aug 26, 2012 3:52 pm
by ngp99
Hi

Yes that was what I started with, though it came in some other freetronics tutorial. It is now pretty clear that the vital part is the pin allocation line , as I described above. I have had every LCD sketch in the Arduino IDE work OK when I substituted the line with

LiquidCrystal lcd(8,9,4,5,6,7);

I have given up on the buttons as I don't need them.

I now understand what a reef tank is. Very nice and good luck with that. What I am doing is a bit more prosaic. I am trying to team a pair of thermometer probes and a water flow sensor to make a heat meter that will send me emails from underneath a ski lodge in Perisher Valley.

Re: LCD reallocation of pins?

Posted: Tue Aug 28, 2012 12:17 am
by ngp99
Thanks, I should have been more specific. I believe I used the same sketch before. The "right" button works OK, and it can reset too. All the rest are duds. From this I conclude the software is kosher and, as they all work off one pin, the other buttons are faulty.

The shield was very cheap, I think the display is fine, I don't need the buttons, I have learned enough, and it isn't worth retuning it.

Re: LCD reallocation of pins?

Posted: Tue Aug 28, 2012 1:25 am
by ngp99
Thanks! I have posted my next problem separately! Pin problems, I think....