#include <LiquidCrystal.h>
// Initialize the LiquidCrystal library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// Set up the LCD's number of columns and rows
lcd.begin(16, 2);
// Set up pin 13 as an output
pinMode(13, OUTPUT);
}
void loop() {
// Turn on the LED
digitalWrite(13, HIGH);
// Print on LCD when LED is on
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Led is on");
// Wait for 2 seconds
delay(2000);
// Turn off the LED
digitalWrite(13, LOW);
// Print on LCD when LED is off
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Led is off");
// Wait for 2 seconds
delay(2000);
}