#include <LiquidCrystal_I2C.h> //This line includes the LiquidCrystal_I2C library which provides functions to control the LCD over I2C protocol.
#define lcd_address 0x27 //lcd_address: The I2C address of the LCD. 0x27 is a common default address.
#define lcd_row 2
#define lcd_col 16 //lcd_col and lcd_row: Defines the LCD size (16 columns × 2 rows).
LiquidCrystal_I2C lcd(lcd_address, lcd_col, lcd_row); //Creates an lcd object to interact with the display using the defined address and size.
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2); //Initializes the LCD with 16 columns and 2 rows.
lcd.init(); //Initializes the I2C communication.
lcd.backlight(); //Turns on the LCD backlight.
lcd.setCursor(3,0); //Sets the cursor to column 3, row 0 (top row). Cursor position starts from (0, 0).
lcd.print("Hello World");
lcd.setCursor(2,1);
lcd.print("Naan Mudalvan");
}
void loop() {
// put your main code here, to run repeatedly:
}