Pages: [1]   Go Down
Author Topic: LCD Question  (Read 623 times)
0 Members and 1 Guest are viewing this topic.
Leeds, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I wonder if somebody could advise me please.

I have a couple of little LCD projects up and running and on the whole, I’m very pleased with them.
I have noticed though, that the pin configurations in the sketches are different.

Below are two examples of different sketches where the LCD is declared:

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

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


They both work, but how?
How does the Arduino know which pin is connected to where?
Can you use any pins you want as long as you declare them?
Do they have to be declared in a certain order for it to work?

Thanks for any advice.

Kind regards
Paul
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2740
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look at the library documentation:
http://arduino.cc/en/Reference/LiquidCrystal
and more specifically about your initialization questions here:
http://arduino.cc/en/Reference/LiquidCrystalConstructor

That should help clear things up.

--- bill
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 4395
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All they really had to do was just include a comment - but that would make things too easy.

Code:
//LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Don
Logged

Leeds, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's great guys, thank you very much.

I was hoping that would be the case as it gives me a lot more flexibility with my pin placing.

I searched lots of posts first but completely forgot about the reference section.

Thanks again.

Kind regards
Paul
Logged

Pages: [1]   Go Up
Jump to: