#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define LCD1_ADDRESS 0x27 // Address of the first LCD
#define LCD2_ADDRESS 0x26 // Address of the second LCD
#define LCD_COLUMNS 16
#define LCD_ROWS 2
LiquidCrystal_I2C lcd1(LCD1_ADDRESS, LCD_COLUMNS, LCD_ROWS);
LiquidCrystal_I2C lcd2(LCD2_ADDRESS, LCD_COLUMNS, LCD_ROWS);
void setup() {
lcd1.init(); // Initialize the first LCD
lcd1.backlight(); // Turn on the backlight of the first LCD
lcd2.init(); // Initialize the second LCD
lcd2.backlight(); // Turn on the backlight of the second LCD
}
void loop() {
for (int i = 0; i < 100; i++) {
int tens = i / 10; // Get the tens digit
int ones = i % 10; // Get the ones digit
// Set the cursor positions for LCD1 and LCD2
lcd1.setCursor(0, 0);
lcd2.setCursor(0, 0);
// Print the numbers on LCD1 and LCD2
lcd1.print(tens);
lcd2.print(ones);
// Add a delay to make the numbers visible
delay(500);
}
}