Challenge

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

Q.)

Ans-

#include//Liberary for 12c communication function

#include //liberary for LCD display function

Liquidcrystal lcd(2,7,8, 9, 10, 11);

void setup()

{

lcd begain(16,2)

lcd set cursor(0,0);

lcd print("CYENT");

lcd.print("12c masterARDUNIO");

delay(5000);

lcd.clear();

serial.begain(9600);

wire.begain();

}

void loop()

{

wire.requestform(8,1);

byte Master Recive=wire.read();

int potvalue =analog read(AD);

byte Master Send=map(potvalue0 , 1023,0, 127);

wire begain transmision(8);

wire.write(Master Send);

wire end transmission();

lcd set cursor(0 ,0);

lcd print(">>Master<<");

lcd print("Salveval");

lcdprint("Master Recived Form Salve");

Serial printn(Master Recived");

delay(500);

lcd clear();

}

void recived Event

{

SalvedRecived = wite.read();

}

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.

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.