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

#define LCD_I2C_ADDR 0x27
#define PCF8574_I2C_ADDR 0x20

#define LCD_COLUMNS 16
#define LCD_ROWS 2

LiquidCrystal_I2C lcd(LCD_I2C_ADDR, LCD_COLUMNS, LCD_ROWS); // Modified initialization

void setup() {
  Wire.begin();

  // Initialize the LCD
  lcd.begin(LCD_COLUMNS, LCD_ROWS); // Modified initialization

  // Initialize the PCF8574
  Wire.beginTransmission(PCF8574_I2C_ADDR);
  Wire.write(0xFF); // Set all pins of PCF8574 as inputs (if needed)
  Wire.endTransmission();
  
  // Turn on the backlight
  lcd.backlight();
  
  // Print a message to the LCD
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");
  lcd.setCursor(0, 1);
  lcd.print("I2C LCD Test");
}

void loop() {
  // Your loop code here
}
pcf8574Breakout