Project 1 - Interfacing a 16*2 LCD with Arduino using I2C protocol
Interfacing a 16*2 LCD with two Arduino’s (one for Master and one for Slave) using Inter-Integrated Circuit (I2C) communication protocol” by sending the message to LCD using I2C communication protocol and display the message on LCD screen.
// Master code
#include <LiquidCrystal.h>
// LiquidCrystal lcd(rs,enable,lcd,d5,d6,d7);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16,2); // Set up the number of columns and rows on the LCD.
}
void loop()
{
lcd.setCursor(0,0); //Sets Cursor at line one of LCD
lcd.print("Master and slave concept"); //Prints Slave Value in LCD
delay(1000);
}
// Slave code
#include <LiquidCrystal.h>
// LiquidCrystal lcd(rs,enable,lcd,d5,d6,d7);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16,2); // Set up the number of columns and rows on the LCD.
}
void loop()
{
lcd.setCursor(0,0); //Sets Cursor at line one of LCD
lcd.print("Master and slave concept"); //Prints Slave Value in LCD
delay(1000);
}
