Arduino – Updated LiquidCrystal library

Lcdblue162Ard Lrg-1
Arduino – LiquidCrystal library, now updated from Adafruit! Include 4-bit and 8-bit modes and more functionality. If you are running Arduino 0016 or earlier, please download the current version of the LiquidCrystal library and install it in your hardware/libraries folder.

The LiquidCrystal library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

Filed under: arduino,leds-lcds — by adafruit, posted July 10, 2009 at 1:46 pm


Try Adafruit's new iPhone & iPad app for makers! Circuit Playground! "Incredibly handy for anyone working in electronics. Perfect for engineers and non-engineers alike."
Looking for engineers, makers and the builders of dreams? Try our Adafruit job boards.
Join our weekly Adafruit SHOW-AND-TELL at 9:30pm ET every Saturday night! Then at 10pm, ASK-AN-ENGINEER with Ladyada and the Adafruit team!

14 Comments

  1. I thought the old library already had 4 and 8 bit modes. What other changes were made, is there a change log?

    Thanks

    Comment by brakk — July 10, 2009 @ 2:52 pm

  2. theres a change log on the developers mailing list. its nearly completely rewritten and works much better.

    Comment by ladyada — July 10, 2009 @ 3:01 pm

  3. Looks like a nice rewrite. One feature of the HD44780 driver that no one seems to pay attention to is defining custom characters so it’s nice to see that added.

    Question… why not check the drivers busy flag instead of using fixed delays for each command?

    I wrote a complete library some time ago (which no one seems to use… sigh) that does away with the fixed delays and I found it to be more reliable (and more efficient) than using delays.

    http://www.slashdev.ca/arduino-lcd-library/

    Comment by JiGGaK — July 11, 2009 @ 10:07 am

  4. for arduino users, a pin is more valuable than 1 ms

    Comment by ladyada — July 13, 2009 @ 7:48 pm

  5. I tried compiling the sample HelloWorld sketch and I am getting the following errors:-

    o: In function `loop’:
    C:\DOCUME~1\ckng\LOCALS~1\Temp\build46647.tmp/Temporary_4160_8511.cpp:52: undefined reference to `LiquidCrystal::setCursor(unsigned char, unsigned char)’

    o: In function `setup’:
    C:\DOCUME~1\ckng\LOCALS~1\Temp\build46647.tmp/Temporary_4160_8511.cpp:45: undefined reference to `LiquidCrystal::begin(unsigned char, unsigned char, unsigned char)’

    Couldn’t determine program size: C:\Program Files\Arduino\hardware/tools/avr/bin/avr-size: ‘C:\DOCUME~1\ckng\LOCALS~1\Temp\build46647.tmp\HelloWorld.hex’: No such file

    Can anyone help? I am an Arduino newbie. Thanks!

    Comment by CK — July 17, 2009 @ 11:26 am

  6. CK,
    Delete or move the old LiquidCrystal library from the hardware folder.

    -chaz

    Comment by chaz — July 19, 2009 @ 7:44 pm

  7. Does this improved adafruit LCD library support 4×20 modules? I can get the Hello World! sketch to work. But the serial LCD sketch does not seem to display properly. I am using LCDsmartie 5.3 to send winamp track data to the display. But only lines one and three display data. Line one works, but line three only sort of works. When I tell LCDsmartie to put stuff on lines 4 or 2 it is blank or goes to line 3. Bug in the software or am I doing something wrong??

    Comment by Confused Robot — August 6, 2009 @ 10:17 pm

  8. “only lines one and three display data”

    I believe that the 4 line modules work as 2 individually addressed modules if that makes any sense or helps you.

    Comment by Dave — August 7, 2009 @ 1:44 am

  9. I have never programmed a library for the arduino and am just learning c/processing. So I really don’t understand the changes that where made from the original lcd library or how the software works/determines how many lines the display has available so it displays correctly.

    I do know that each line is considered 40 long regardless of how long the visible line is and if you have more than 2 lines they are split 20 on first line, 20 on third line, then 20 on second line and 20 on fourth line. But how the software handles that, if it does, I don’t know. As I understand it one controller can control up to 2×40 or 4×20. The only time you would see dual controllers is on a display with 4×40, etc. lines or more.

    Comment by Confused Robot — August 7, 2009 @ 2:32 am

  10. please post in the forums for questions / troubleshooting – thx!

    Comment by adafruit — August 7, 2009 @ 10:09 am

  11. Forums? I don’t see a link to a forum…

    Comment by Confused Robot — August 7, 2009 @ 12:53 pm

  12. http://www.ladyada.net/forums/

    Comment by adafruit — August 7, 2009 @ 12:54 pm

  13. You say this library is only for Arduino versions later than 16? But 16 is the current version for windows/mac/linux! Can somebody tell me if this works with version 16?

    Comment by Joseph — August 9, 2009 @ 10:07 am

  14. hi joseph – please post up in the forums http://www.ladyada.net/forums/

    Comment by adafruit — August 9, 2009 @ 11:12 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

www.flickr.com
adafruit's items Go to adafruit's photostream
www.flickr.com
items in Adafruits More in Adafruits pool