#include <LiquidCrystal_I2C.h>//add the library
LiquidCrystal_I2C display(0x27, 16,2);//create an object & set the dimension and address
//create variables:
int age = 12;
String name = "Rafel Casipit";
void setup() {
// put your setup code here, to run once:
display.init();//initiate the LCD
display.clear(); //clear any dislay
display.backlight(); //turn on the backlight
}
void loop() {
// put your main code here, to run repeatedly:
display.setCursor(0,0); //set the cursor in this coordinates
display.print("My Name is:"); //display text
display.setCursor(0,1); //set cursor to the 2nd row
display.print(name); //display variable values
delay(4000); //wait for 4 secs
display.clear(); // clear the display
display.setCursor(0,0);
display.print("I am: ");
display.setCursor(6,0);
display.print(age);
display.setCursor(0,1);
display.print("Yrs. Old");
delay(4000);
display.clear();
}