ESP32+i2c+LCD

nigelt
Posts: 1
Joined: Fri Mar 08, 2024 5:38 pm

ESP32+i2c+LCD

Postby nigelt » Fri Mar 08, 2024 5:53 pm

I'm trying to use an ESP32-S.

I have connected an LCD via pins 21 and 22 (plus power).

The program compiles but the display never changes.
I have run an i2c finder progrma and that comes back with the default 0x27 for my LCD with i2c back pac.

Arduino IDE 2.3.2

/*

* For more detail (instruction and wiring diagram), visit https://esp32io.com/tutorials/esp32-lcd-20x4
*/

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 20, 4); // I2C address 0x27, 20 column and 4 rows

void setup() {
lcd.init(); // initialize the lcd
lcd.backlight();

lcd.setCursor(0, 0); // move cursor the first row
lcd.print("LCD 20x4"); // print message at the first row
lcd.setCursor(0, 1); // move cursor to the second row
lcd.print("I2C Address: 0x27"); // print message at the second row
lcd.setCursor(0, 2); // move cursor to the third row
lcd.print("DIYables"); // print message at the third row
lcd.setCursor(0, 3); // move cursor to the fourth row
lcd.print("www.diyables.io"); // print message the fourth row
}

void loop() {
}

liaifat85
Posts: 139
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32+i2c+LCD

Postby liaifat85 » Sat Mar 09, 2024 9:30 am

Run an I2C scanner sketch on your ESP32 to confirm that it detects the LCD at address 0x27. If it doesn't detect the device, there might be a wiring or communication issue.

Who is online

Users browsing this forum: Google [Bot] and 141 guests