This circuit integrates an ESP32 microcontroller with a 16x2 I2C LCD screen. The ESP32 is responsible for controlling the display on the LCD, showing messages in a loop with specified delays. The communication between the ESP32 and the LCD is established via the I2C protocol, utilizing two data lines: SCL (Serial Clock Line) and SDA (Serial Data Line).
/*
* This Arduino Sketch interfaces an ESP32 with an I2C LCD 16x2 screen.
* The ESP32 displays two messages on the LCD screen in a loop with delays.
* Connections:
* - ESP32 GND to LCD GND
* - ESP32 Vin to LCD VCC (5V)
* - ESP32 D22 to LCD SCL
* - ESP32 D21 to LCD SDA
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
lcd.init();
lcd.backlight();
lcd.print("Welcome");
delay(2000);
lcd.init();
lcd.backlight();
lcd.print("EV CHRG");
delay(2000);
}
void loop() {
delay(1000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("SLOT1");
delay(2000);
}
Filename: sketch.ino
Description: The code initializes the I2C LCD screen and prints the messages "Welcome" and "EV CHRG" on the display, followed by "SLOT1" in a continuous loop. The ESP32 communicates with the LCD using the I2C protocol, with the SCL and SDA pins connected to the corresponding pins on the LCD.