// Forum: https://forum.arduino.cc/t/lcd-i2c-wiring-issue/1235511
// This Wokwi project: https://wokwi.com/projects/392526566245241857
//
// Question: Can you make your own LCD backpack and will the
//           common "LiquidCrystal I2C" library work with it ?
// Answer: Yes
// 
// There are working (Custom Chip) transistors, but I could not
// make such a "transistor" work in this circuit.
// I changed the resistors for the address lines to 10k.
//
//
// Custom Chip PCF8574 from this project:
//   https://wokwi.com/projects/350228699564474964
// Because it was mentioned here:
//   https://github.com/wokwi/wokwi-features/issues/546
//
// Backpack pin order (0...7): RS,RW,E,Backlight,D4,D5,D6,D7
//   The Backlight is via a transistor
//
//

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x20,16,2);


void setup() 
{
  Serial.begin(115200);
  Wire.begin();

  Serial.print("Searching for I2C addresses: ");
  for(int i=1; i<=127; i++)
  {
    Wire.beginTransmission(i);
    int error = Wire.endTransmission();
    if(error == 0)
    {
      Serial.print("0x");
      Serial.print(i,HEX);
      Serial.print(", ");
    }
  }
  Serial.println("-> Finished");

  lcd.init();
  lcd.clear();
  lcd.backlight();

  lcd.setCursor(2,0);
  lcd.print("Hello World");
}

void loop() 
{
  lcd.setCursor(0,1);
  lcd.print(millis());
  delay(random(100,500));
}
PCF8574Breakout
Backlight is always on
LCD Backpack