High-performance LCD library for I2C Backpack Module

LiquidTWI: High-performance LCD library for I2C Backpack Module, FalconFour writes –

I like fast things. And I like clean code. Often, the two go hand-in-hand 😉

After looking through the modified LiquidCrystal library for use with the i2c backpack and darn near crying when I saw all the faux digitalRead() and pinMode() being done on each transfer, I was bound and determined to never let that happen to another friendly Arduino user again. I first made a proof of concept modification to the library to “burst” all the “LiquidCrystal::send” bits instead of digitalWrite()’ing them out one at a time (read I2C, modify, write… read, modify, write… read, modify, write… read, modify, write – over 16 I2C commands for each single character). It worked great. I could do animation on the screen once again, and it was smooth.

OK, so the next step… package it up into something usable. I kept running into issues where Wire.h needed to be part of every program I use LiquidCrystal with. It just had to be “forked” to its own library. I’m sure C++ will allow a typedef alias for any libraries/sketches that have LiquidCrystal hard-coded into them… I just haven’t had a need yet. I fully gutted LiquidCrystal of all functions relating to digitalRead/digitalWrite, and made it 100% pure i2c. What a sleek beauty… just watch the video.

Of course, next on my to-do list is a proper animation library for character LCDs. 🙂

LiquidTWI library is attached to this post, also mirrored here: http://hostfile.org/LiquidTWI.rar


I2Cspilcdbackpacklcd Lrg

I2Cspilcdbackpack Lrg

i2c / SPI character LCD backpack. LCD backpacks reduce the number of pins needed to connect to an LCD. LCDs are a fun and easy way to have your microcontroller project talk back to you. Character LCDs are common, and easy to get, available in tons of colors and sizes. (or similar microcontroller) but find that the number of pins necessary to control the LCD can be restrictive, especially with ambitious projects. We wanted to make a ‘backpack’ (add-on circuit) that would reduce the number of pins without a lot of expense.

By using simple i2c and SPI input/output expanders we have reduced the number of pins (only 2 pins are needed for i2c) while still making it easy to interface with the LCD. For Arduino users, we provide a easy-to-use library that is backwards compatible with projects using the ‘6 pin’ wiring.

This backpack will work with any ‘standard’ character LCD, from 8×1 to 40×4 sizes! As long as they have a 16-pin single-line connection header at the top. We carry a few LCDs that work great.

For advanced users, this project can be used for general purpose I/O expansion, the MCP23008 has 8 i/o pins (7 are connected) with optional pull-ups, the SPI 74HC595 has 7 connected outputs.

For a detailed tutorial on usage, including an Arduino library, wiring diagrams, and files, please visit the product page

In stock and shipping now from the Adafruit store!


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: A New Arduino MicroPython Package Manager, How-Tos 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 — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

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


No Comments

No comments yet.

Sorry, the comment form is closed at this time.