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.


Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: Programming Pi 5 PIO, CircuitPython & VSCode and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — Halloween, WiLo, and more!

Maker Business – Adafruit Daily — Slipping through Nvidia’s grip on A.I. chips

Electronics – Adafruit Daily — Crouching LED, Hidden Photodiode

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



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

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

  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/

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

  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!

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

    -chaz

  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??

  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.

  9. Confused Robot

    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.

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

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

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

  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?

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

Sorry, the comment form is closed at this time.