Pages: [1]   Go Down
Author Topic: Sort-out the incorrect "help" in the Arduino 0022 tutorials  (Read 1365 times)
0 Members and 1 Guest are viewing this topic.
Aranyaprathet, Thailand
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I only started playing with Arduino a couple of weeks ago, so the IDE I downloaded should be up-to-date.  Last week I bought an LCD + keypad Shield (DFRobot - brand) , plugged it in, went into C:\Program Files\Arduino\arduino-0022\libraries\LiquidCrystal\examples.

NOTHING worked.  Not a single one of the b****tards.  Oh 'bother' I've bought a dud LCD Shield.

By pure chance I looked at some online examples and noticed the pin numbers were different
From Cursor.pde in the library:
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Which does not work.  And all the examples have the same pin-allocation.

From wherever it was, online:
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
Which works as sweet as you like.

My nearest approach to an LCD screen has been on the mobile phone, so it was to say the least, discouraging that the examples on which I depend, in the authoritative Library are just wrong.

Geoff
Logged

Norway
Offline Offline
Full Member
***
Karma: 0
Posts: 104
Have you thought it over before asking?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Be aware that some of the libraries are not writen for a single shield, the are written for a group of components.
This is why you should always check if the product you bought has the correct pin layout for the example, or adjust the code according to your component(s).

Do not copy, paste and run!
Do then at least a copy ,paste, check and run

:-)
Logged

2B || !2B

... bonding electrons and bits!

Berks, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 153
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Rather than blindly connecting things up and expecting them to work, try to understand how they work smiley
If you tak esome time to understand what the numbers mean in the function LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
and you had the circuit diagram for the hardware you have, then you'll have a better understanding of why the numbers do not match the hardware you have.
At least hopefully, from this mistake, you have learned something of the software and hardware you are experimenting with. smiley

Texy
Logged

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

Quote
If you tak esome time to understand what the numbers mean in the function LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Most beginners go to the Arduino LiquidCrystal tutorial (http://arduino.cc/en/Tutorial/LiquidCrystal) when they start working with their LCD.  That tutorial does not adequately explain the relationship between those numbers and the circuit connections.  See my reply #2 in this thread (http://arduino.cc/forum/index.php/topic,78228.msg590805.html#msg590805) for more on this topic.

Don
Logged

Pages: [1]   Go Up
Jump to: