All you need to know about I2C LCD screens on an Arduino Uno.

Things used in this project
Β
Hardware components
Story
Β
This project is for people who have an I2C lcd screen and canβt find any videos or projects on how to code them.
The first step is to find a working library of them. I use liquid crystal I2C, and wire. link for liquid crystal here, link for wire here [https://www.resistorpark.com/content/Arduino_Libraries/wire.zip]
Β
The second step is to add the libraries to your arduino ide, to do that you go to sketch-> include library -> add zip library then find it in files. If it works, you should get a message saying it worked.
Β
the third step is to wire it up wire up as follows
Β
GND-> ground
Β
VCC-> +5V
Β
SDA-> A4
Β
SCL-> A5
Β
The last step is to upload the code
Β
(be sure to delete everything from your blank sketch before pasting the sketch into it)
Schematics
Β
wiring diagram

Code
Β
Code for screen
// |βββββββββββββββββββββββββββββββββββββββββββββββββββββββ|
// | made by Arduino_uno_guy 11/13/2019 |
// | https://create.arduino.cc/projecthub/arduino_uno_guy|
// |βββββββββββββββββββββββββββββββββββββββββββββββββββββββ|
#include LiquidCrystal_I2C.h
#include Wire.h
//initialize the liquid crystal library
//the first parameter is the I2C address
//the second parameter is how many rows are on your screen
//the third parameter is how many columns are on your screen
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
//initialize lcd screen
lcd.init();
// turn on the backlight
lcd.backlight();
}
void loop() {
//wait for a second
delay(1000)
// tell the screen to write on the top row
lcd.setCursor(0,0);
// tell the screen to write βhello, fromβ on the top row
lcd.print(βHello, Fromβ);
// tell the screen to write on the bottom row
lcd.setCursor(0,1);
// tell the screen to write βArduino_uno_guyβ on the bottom row
// you can change whats in the quotes to be what you want it to be!
lcd.print(βArduino_uno_guyβ);
}
The article was first published in hackster, November 13, 2019
cr: https://www.hackster.io/arduino_uno_guy/i2c-liquid-crystal-displays-5b806c
author: arduino_uno_guy
