Rachana Jain
Published © Apache-2.0

I2C LCD interfacing with Arduino

Learn how to interface an I2C LCD with Arduino Uno and print text, custom characters and numbers on it.

BeginnerFull instructions provided2 hours2
I2C LCD interfacing with Arduino

Things used in this project

Story

Read more

Code

Arduino Code

Arduino
In this Arduino sketch, we’ll print “Hello” on the first line and “PlayWithCircuit” on the second line of the 16×2 LCD display.
/* 
Code to display Strings on I2C LCD
by www.playwithcircuit.com
*/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Format -> (Address,Width,Height )
void setup()
{
  // initialize the lcd
  lcd.init();
  // Turn on the Backlight
  lcd.backlight();
}
void loop()
{
  // Clear the display buffer
  lcd.clear(); 
  // Set cursor (Column, Row)
  lcd.setCursor(0, 0);
  // print "Hello" at (0, 0)   
  lcd.print("Hello"); 
  // Set cursor (Column, Row) 
  lcd.setCursor(0,1);
  // print "PlayWithCircuit" at (0, 1)
  lcd.print("PlayWithCircuit");
  while(1);
}

Credits

Rachana Jain
17 projects • 8 followers
I'm an avid Arduino and electronics enthusiast with a passion for tinkering, experimenting, and bringing innovative ideas to life.

Comments