How to connect ESP32 Cam to LCD I2C

#include <LiquidCrystal_I2C.h>

#define SDA 14
#define SCL 15
#define COLUMNS 16
#define ROWS    2
LiquidCrystal_I2C lcd(0x38, COLUMNS, ROWS);  
void setup(){
  Wire.begin(SDA, SCL);
  lcd.init();   
  lcd.clear();           
  lcd.backlight();                      
  
  lcd.setCursor(0,0);
  lcd.print(" labelektronika ");
  delay(1000);
  lcd.setCursor(0,1);
  lcd.print(" LCD I2C Module ");
  delay(8000);

}

void loop(){

} 

i using esp32 cam, but when i upload and run this code, have no words in LCD. no error, but does not display any text. maybe all of you have a code or library to connect ESP32 CAM with LCD I2C?

It is probably not allowed to define "SDA" and "SCL". They might already be defined somewhere.
Which board have you installed ? The normal ESP32 Espressif boards ?

It does not have a USB connector ? How can you send messages to the Serial Monitor ?

There seems to be problem to connect I2C devices to the ESP32-CAM. Some say to use a software I2C bus.

The ESP32-CAM is a 3.3V chip and your display is probably a 5V display. That does not match very well.

I moved your topic to a more appropriate forum category @kurniawantakulowa_1.

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

what happens when you run an I2C Scanner on the I2C pins, do you see the display at tha correct address ?

Hello Kurniawantakulowa 1,

I'n not sure what you're building here but your code defines SDA & SCL. You should remove these lines as they are already defined by the Arduino. I'm using a Nano and the pins are as follows;

SDA = A4
SCL = A5

They cannot be changed so that could be part of your problem. You can also stack multiple I2C devices on these pins but you will need to find the address of each device and make them unique. Here's some code you can run to find the addresses. Make sure you have the <Wire.h> library installed. Hope this helps. Have a great day.

#include <Wire.h>

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

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (100);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

They can on an ESP32.

If Wire.begin(SDA, SCL); was not allowed on the ESP32(CAM) you would expect a compile error.

Wire.begin(SDA, SCL) is just fine on an ESP32CAM.

Thanks bro, it's work when I use this command