#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the I2C addresses for the two displays
#define I2C_ADDR1 0x27
#define I2C_ADDR2 0x26
#define I2C_ADDR3 0x25

// Set the number of columns and rows for the LCD
#define LCD_COLUMNS 16
#define LCD_ROWS 2

// Create instances of the LiquidCrystal_I2C class
LiquidCrystal_I2C lcd1(I2C_ADDR1, LCD_COLUMNS, LCD_ROWS);
LiquidCrystal_I2C lcd2(I2C_ADDR2, LCD_COLUMNS, LCD_ROWS);
LiquidCrystal_I2C lcd3(I2C_ADDR3, LCD_COLUMNS, LCD_ROWS);

void setup() {
  // Initialize the LCDs
  lcd1.begin(LCD_COLUMNS, LCD_ROWS);
  lcd2.begin(LCD_COLUMNS, LCD_ROWS);
  lcd3.begin(LCD_COLUMNS, LCD_ROWS);

  // Set up any initial configurations if needed
  lcd1.backlight(); // Turn on the backlight for the first display
  lcd2.backlight(); // Turn off the backlight for the second display
  lcd3.backlight(); // Turn off the backlight for the second display

  // Print initial messages
  lcd1.print("Hello, Display 1!");
  lcd2.print("Hello, Display 2!");
  lcd3.print("Hello, Display 3!");

  // Set the cursor to the beginning of the second line for both displays
  lcd1.setCursor(0, 1);
  lcd2.setCursor(0, 1);
  lcd3.setCursor(1, 1);
}


void loop() {
  // You can update the content on the displays in the loop if needed

  // For example, scrolling text on Display 1
  lcd1.scrollDisplayLeft();

  // For example, blinking text on Display 2
  lcd2.noDisplay();
  delay(250);
  lcd2.display();
  delay(250);

  lcd3.scrollDisplayRight();
}