
Hello guys, welcome back to my blog. Today we are going to talk about the second part of the LCD screen control article. We talked about the first part of this topic in a previous article. Click the link and read it. In that article, several wires had to be used to control the LCD screen. We also had to prepare the circuit for that. Putting this into a project is a very difficult task. This required the use of six digital pins from the Arduino. Okay, today we will talk about how to do this task using four pins. That is, this LCD can be controlled by four wires. For that, we need the I2C module only.
What is an I2C module?
Components
Step 1
Arduino Uno

I2C module

Jumper wires

Step 2
Connect these components as follows. First, solder the i2c module to the LCD screen.


Step 3
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C dis(0x27, 16, 2);
void setup() {
dis.init();
dis.backlight();
}
void loop() {
dis.setCursor(3, 0);
dis.print("SriTu Tech");
}




Step 4

Step 5
Upload this code and enjoy it.


/*LCD display control using two wires.
created by the SriTu Tech team.
Read the code below and use it for any of your creation
*/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C dis(0x27, 16, 2);
uint8_t heart[8] = {0x0, 0xa, 0x1f, 0x1f, 0xe, 0x4, 0x0};
void setup() {
dis.init();
dis.backlight();
dis.createChar(1, heart);
}
void loop() {
//welcome();
//End();
}
void welcome() {
dis.setCursor(2, 0);
dis.print("HELLO GUYS!");
for (int a = 0; a < 16; a++) {
dis.setCursor(a, 1);
dis.write(1);
delay(500);
}
dis.clear();
dis.setCursor(1, 0);
dis.print("WELCOME TO LCD");
dis.setCursor(0, 1);
dis.print("TUTORIAL");
for (int i = 8; i < 16; i++) {
dis.setCursor(i, 1);
dis.print(".");
delay(500);
}
dis.clear();
}
void End() {
dis.clear();
dis.setCursor(0, 0);
dis.print("THANKS FOR");
dis.setCursor(0, 1);
dis.print("WATCHING");
for (int i = 10; i < 16; i++) {
dis.setCursor(i, 0);
dis.print(".");
delay(500);
}
for (int i = 8; i < 16; i++) {
dis.setCursor(i, 1);
dis.print(".");
delay(500);
}
dis.clear();
dis.setCursor(0, 0);
dis.print("PLEASE SUBSCRIBE");
dis.setCursor(0, 1);
dis.print("MY CHANNEL");
for (int a = 10; a < 16; a++) {
dis.setCursor(a, 1);
dis.print(".");
delay(500);
}
}
This article is also presented in the video below. Please watch it and comment on your ideas below. We will meet in the next post. Have a good day everyone. Bye-bye.