#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the LCD (I2C address 0x27, 16 cols, 2 rows)
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
lcd.setCursor(0, 0); // Set the cursor to the first row
lcd.print("Counting:");
}
void loop() {
for (int i = 1; i <= 10; i++) {
lcd.setCursor(0, 1); // Move to the second row
lcd.print(" "); // Clear the row by printing spaces
lcd.setCursor(0, 1); // Reset the cursor
lcd.print("Number: ");
lcd.print(i); // Print the current number
delay(1000); // Wait for 1 second
}
}