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!


Halloween season is here!
Halloween season is here! Check out all the posts, gift guides, and more!

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 PRODUCT – Adafruit RP2350 22-pin FPC HSTX to DVI Adapter for HDMI Displays

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: Adafruit Grand Opening, Profile MicroPython Memory and More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi — Classic editor

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

Adafruit IoT Monthly — Garden Lights, Bluetooth 6.0, and more!

Maker Business – Adafruit Daily — A look at Boeing’s supply chain and manufacturing process

Electronics – Adafruit Daily — When do I use X10?

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.