Challenge

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

To be Evaluated by Abhinaya Inbamani maam

MASTER CODE

#include

#include

String a;

void setup(){

  Wire.begin(2);

  Wire.onRequest(send);

  a="Hi Master";

}

void send(){

  Write.print(a);

}

void loop(){ 

}

SLAVE CODE

#include

#include

// C++ code

//

#include

#include

LiquidCrystal display(12,11, 5, 4, 3, 2);

void setup()

{

  display.begin(16,2);

  display.print("Hi Slave");

  Wire.begin();

  Wire.requestFrom(2, 10);

  Serial.begin(9600);

}

void loop()

{

  display.setCursor(0,1);

  while(Wire.available()){

    char c=Wire.read();

    display.print(c);

    Serial.print(c);

  }

}

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.