Arduino I2C LCD Example
This Arduino sketch demonstrates how to use an I2C-enabled LCD display with an Arduino board. The LiquidCrystal_I2C library is used to control the LCD, and the sketch also includes a function to automatically detect the I2C address of the connected LCD module.
Getting Started
Prerequisites
- Arduino IDE installed on your computer.
- An Arduino board (e.g., Arduino Uno) and appropriate USB cable.
- An I2C-enabled LCD module.
- Wiring connections between the Arduino and the LCD module.
Wiring Instructions
- Connect the SDA (Serial Data) pin of the LCD module to the SDA pin on the Arduino.
- Connect the SCL (Serial Clock) pin of the LCD module to the SCL pin on the Arduino.
- Make sure to connect the power (VCC) and ground (GND) pins appropriately.
- Double-check the wiring and connections to ensure they are correct.
Installation
- Clone or download this repository to your local machine.
- Open the Arduino IDE and load the
main.ino
sketch from the repository.
- Upload the sketch to your Arduino board.
Usage
- After uploading the sketch, open the Arduino Serial Monitor (Tools > Serial Monitor).
- The sketch will automatically detect the I2C address of the connected LCD module and initialize it.
- You should see text scrolling on the LCD screen with the message “For My Love,” “Diah Nurhasna,” “I Gave You,” and “All Of My Heart.”
- The text will display for 5 seconds before clearing and repeating.
Troubleshooting
If you encounter any issues, make sure to double-check your wiring connections and the I2C address of your LCD module.
Author
License
This project is licensed under the MIT License - see the LICENSE file for details.