Project 1 - Interfacing a 16*2 LCD with Arduino using I2C protocol
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the LCD object
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// Initialize the I2C bus
Wire.begin();
// Initialize the LCD
lcd.init();
lcd.backlight();
// Send a message to the LCD
lcd.setCursor(0, 0);
lcd.print("Hello World!");
// Send the message to the Slave Arduino
Wire.beginTransmission(9);
Wire.write("Hello World!");
Wire.endTransmission();
}Materials Required
Two Arduino boards
16x2 LCD module
I2C Module
Jumper wires
Breadboard
Circuit Connections
Connect the I2C module to the Arduino boards, as follows:
Master Arduino
void loop() {
// Do nothing
}