0Pricing
Arduino & IoT Academy · Lesson

LiquidCrystal_I2C Library

Initialize the display and set its address.

LiquidCrystal_I2C Library is a free Arduino & IoT Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What the Library Does

The LiquidCrystal_I2C library handles all the low-level I2C chatter for you. You just call simple commands to show text. 📚

Install It Once

Open the Library Manager in the Arduino IDE and search for LiquidCrystal_I2C. Click install and it is ready to use.

Include the Header

At the top of your sketch you add an include line so the compiler can find the library's code.

#include <LiquidCrystal_I2C.h>

Create the Object

You make one lcd object that represents your display. Every command you give will go through this object.

LiquidCrystal_I2C lcd(0x27, 16, 2);

The Address Argument

The first number is the I2C address. If your display stays blank, swap 0x27 for 0x3F, the other common value.

Columns and Rows

The next two numbers tell the library the size: 16 columns and 2 rows. This matches a standard 16x2 panel.

Initialize in setup

Inside setup you call lcd.init() once to wake the display and prepare it to receive text.

void setup() {
  lcd.init();
}

Turn On the Backlight

The screen starts dark until you call lcd.backlight(). This lights it up so the characters are readable.

lcd.backlight();

Print Your First Word

Now lcd.print() sends text to the screen. Whatever you pass appears starting at the top-left corner. 🎉

lcd.print("Hello!");

Clearing the Screen

Call lcd.clear() to wipe everything and move the cursor back to the start before writing fresh text.

lcd.clear();

If It Stays Blank

Blank screen with backlight on usually means the wrong address. Run an I2C scanner sketch to find the real one.

Quick Check

Your sketch compiles but the LCD stays dark even with power. Which call did you likely forget?

Recap

You included LiquidCrystal_I2C, created an lcd object with its address and size, then called init and backlight. Your display is alive. ✅

Frequently asked questions

Is the “LiquidCrystal_I2C Library” lesson free?

Yes — the full text of “LiquidCrystal_I2C Library” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.

What will I learn in “LiquidCrystal_I2C Library”?

Initialize the display and set its address. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Arduino & IoT Academy?

No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “LiquidCrystal_I2C Library” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Arduino & IoT Academy lesson?

Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Wire a 16x2 LCD (I2C Backpack)
  2. LiquidCrystal_I2C Library
  3. Position the Cursor & Print
  4. Live Sensor Dashboard
← Back to Arduino & IoT Academy