LCD 1602 Driver with ESP32 I2C 1.1
This is a complete driver for LCD 1602 using I2C with the ESP32
|
A complete driver for Hitachi compatible 16 x 2 modules with the i2c expander on ESP32. The driver runs the LCD in 4-bit mode and exposes a small and easy to use API for initialization and writing.
Espressifs IoT development framework, which contains all the essential dependencies for this project. You can find a guide for installing it here: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html
You can use any device, but might need to configure the pins.
Make sure it's Hitachi 44780 compatible and has a I2C expander.
For compiling and building the project.
GCC For windows
Guide for windows
GCC For Mac
brew install gcc
GCC For Linux
sudo apt-get install gcc
Cmake
This is our build tool for the project and routinely used for raspberry pi pico projects.
The driver standard pinout is set in lcd_i2c.h:
Example of circuit for this driver
Clone this project into components/ in your project. ESP-IDF will automatically recognize the file and it can then be used in your project.
git clone https://github.com/lafftale1999/lcd_1602_i2c_driver.git
lcd_1602_init()
Initializes the LCD according to the datasheet. Returns 0 if successful.
lcd_1602_send_string()
Writes out string on the display. Returns LCD_WRITE_FINISHED if successful. LCD_WRITE_INTERRUPTED if string is too long for screen.
These can be changed to fit your own project.
This project is not made to build on its own, it needs to be incorporated into a bigger system with a CMake build file.
I'm currently studying to become an embedded developer and learning about writing drivers based on datasheets from manufacturers. If you have any questions please feel free to reach out!