// include the library code:
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
// initialize the library for I2C LCD
LiquidCrystal_I2C lcd_i2c(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(19, 23, 18, 17, 16, 15);
void setup() {
lcd_i2c.clear(); // clear display
lcd.clear();
// init I2C LCD & backlight
lcd_i2c.init();
lcd_i2c.backlight();
lcd_i2c.print ( "I2C LCD." );
// set up the LCD's number of columns and rows:
lcd.begin(16, 4);
// Print a message to the LCD.
lcd.print("Normal LCD");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd_i2c.setCursor(0, 1);
// print the number of seconds since reset:
lcd_i2c.print (millis()/1000);
lcd_i2c.print ( "SECONDS" );
delay(100);
//Here cursor is placed on first position (col: 0) of the second line (row: 1)
lcd. setCursor (0, 1);
// We write the number of seconds elapsed
lcd.print ( millis () / 1000);
lcd.print ( "SECONDS" );
delay (100);
}