#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Define the I2C SDA and SCL pins explicitly
#define SDA_PIN 21 // ESP32 GPIO21 for SDA
#define SCL_PIN 22 // ESP32 GPIO22 for SCL
// Create the LCD object with the I2C address and LCD dimensions (16 columns, 2 rows)
LiquidCrystal_I2C lcd(0x27, 16, 2); // Replace 0x27 with your LCD's I2C address if different
void setup() {
// Initialize I2C with the custom SDA and SCL pins
Wire.begin(SDA_PIN, SCL_PIN);
// Initialize the LCD
lcd.begin(16, 2); // 16 columns, 2 rows
lcd.backlight(); // Optional: Turn on the backlight
// Display "hi..." on the LCD
lcd.setCursor(0, 0); // Move cursor to the first column, first row
lcd.print("hi...");
}
void loop() {
// Nothing to do here for now
}