Challenge

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

//Master Code//


#include<LiquidCrystal.h> //Library for LCD display function

LiquidCrystal lcd_1(12, 11, 5, 4, 3, 2); //Defining LCD 1 Module Pins (RS,EN,D4,D5,D6,D7)
int va11 = A4;
int va12 = A5;
void setup()
{
lcd_1.begin(16,2); //locating display starting point as its 16*2 lcd display

lcd_1.setCursor(4,0);

lcd_1.print("Master:"); //printing
}
void loop()
{

lcd_1.setCursor(0,1);
lcd_1.print("Just");
delay(1000);
}

//Slave Code//

#include <LiquidCrystal.h>

LiquidCrystal lcd_2(12, 11, 5, 4, 3, 2); //Defining LCD 2 Module Pins (RS,EN,D4,D5,D6,D7)
int va11 = A5;
int val2 = A4;
void setup()
{
lcd_2.begin(16,2);
lcd_2.setCursor(5,0);
lcd_2.print("Slave:");
}
void loop()
{
lcd_2.setCursor(0,1);
lcd_2.print("Done!");
delay(1000);
}

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.