LCD I2C Arduino
How to make Typewriter Effect LCD I2C 20×4 Arduino? – In this article, I will share the Arduino LCD i2c program code that will display the effect of a typewriter or letter typing with questions. For example, you can see like this one:
It’s easy, for the circuit and basic code you can look at the article LCD 20×4 Arduino I2C Code Basic Tutorial.
Now, i only share the program code. You can copy and paste the program code in your arduino ide code editor and upload it to your board.
Program Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 20, 4);
char array1[] = " www.chippiko.com";
char array2[] = "Hey, are you sure?";
char array3[] = "Yes, of course!";
void setup()
{
lcd.init();
lcd.backlight();
}
void loop()
{
lcd.clear();
// Show text 1
lcd.setCursor(0, 0);
for (int i = 0; i < sizeof(array1) - 1; i++)
{
lcd.print(array1[i]);
delay(20);
}
delay(1000);
//Show text 2
lcd.setCursor(0, 2);
for (int i = 0; i < sizeof(array2) - 1; i++)
{
lcd.print(array2[i]);
delay(50);
}
delay(1000);
//show text 3
lcd.setCursor(0, 3);
for (int i = 0; i < sizeof(array3) - 1; i++)
{
lcd.print(array3[i]);
delay(50);
}
delay(5000);
}
Done