Challenge

Project 1 - Interfacing a 16*2 LCD with Arduino using I2C protocol

#include

#include

// 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

}

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.