Pages: [1]   Go Down
Author Topic: update to LiquidCrystal  (Read 1404 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 239
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I re-wrote much of the LiquidCrystal library (for non-graphical LCDs like 16x2 line ones, etc)
it should now work much better for people and I'm looking to get it included in the next rev of the Arduino IDE and have it be the 'gold standard' for LCD interfacing

what has been added:
4-bit init. works even without power-cycling
correct timing delays reduce chance of 'garbling'
R/W pin not needed, saves 1 pin!
more commands to control the LCD display
you can set it up for 2 or 4 line displays with begin()
example for creating custom characters
much faster than old LiquidCrystal and LCD4Bit
etc.

please check it out, let me know how it works for you!
http://www.ladyada.net/learn/arduino/LiquidCrystal-07-06.zip
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 18
Posts: 1628
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome!  This is a very welcome update!
Logged

New Jersey
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Arduino == up all night
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice! I did have to ground RW after disconnecting in order to get it working.

"way befer" Really? And I though that was a local thing...
Logged

Why do it right the first time, when building and rebuilding is  so much fun?

0
Offline Offline
Full Member
***
Karma: 0
Posts: 239
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

oh right yes you need to ground r/w
forgot to mention
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the update to the library. It's always nice to see new features added.
Logged

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

ladyada:

Quote
and I'm looking to get it included in the next rev of the Arduino IDE
I hope you have more luck than I did.  LiquidCrystal certainly needs some help.

Don
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 239
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here are some new tutorials as well!
http://arduino.cc/en/Tutorial/LiquidCrystal
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 49
Freediving, spearfishing, alt energy, motion control, christian
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Correct me if I'm wrong...

I'm seeing conflicting pin numbers on the page http://arduino.cc/en/Tutorial/LiquidCrystal

The wiring diagram image shows LCD pins D0-D4 in use, while the code below says:
"  * LCD D4 pin to digital pin 5
  * LCD D5 pin to digital pin 4
  * LCD D6 pin to digital pin 3
  * LCD D7 pin to digital pin 2"



ASIDE:
I used the old library with great success but in upgrading I'm getting some funky hieroglyphics — I'm guessing that might be caused by the pin issues mentioned above as I've got flying leads from my 40x2 panel connected to D4-D7.  Out with the 'iron again I guess!   :-/

[m]
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like the wiring diagram has the data pins backwards- should be D0-D7 from left to right instead of D7-D0. The text has the correct information. Four bit mode always uses the top 4 data pins, D4-D7. If you've had it working before, the wires you have soldered to the LCD are fine.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 49
Freediving, spearfishing, alt energy, motion control, christian
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that beanoman, you saved me a lot of bother.

I had already tried wiring 'backwards' (D7-D4) to no avail.

More tinkering required.

[m]
Logged

Stockholm, Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great!

I can not find an updated keywords file in the link. That could be nice.

I had to change the offsets in setCursor to { 0x00, 0x40, 0x10, 0x50 } to get the third and fourth line to start correctly but I guess that has something to do with my display (JHD164A).
Logged

New York, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Howdy. I don't check PMs often, so email me!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Which datasheet are you using for the HD44780?  I was using this one from Adafruit:  http://www.ladyada.net/media/lcd/RT162.pdf  And this one from Sparkfun:  http://www.sparkfun.com/datasheets/LCD/GDM1602K-Extended.pdf  

Both of them show the pinouts as shown in the LiquidCrystal Tutorial.  I've tried that wiring with a half dozen different LCD's from different sources, and all worked properly for me. I also tried them on pins 0 - 4 according to those diagrams and got garbage.  So I'm perplexed as to why you've got different pinouts, or different documentation for it.  But if you've got a link to different docs on the module, I'm happy to try them out.
Logged

Pages: [1]   Go Up
Jump to: