Challenge

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

#include<Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal display(12, 11, 5, 4, 3, 2);

void setup()
{
  display.begin(16, 2); 
  display.print("Hai slave");
  
  Wire.begin();
  Wire.requestFrom(2,10);
  Serial.begin(9600);
}

void loop()
{
  display.setCursor(0, 1);
  //display.clear();
  //delay(1000);
  while(Wire.available())
  {
    char c=Wire.read();
    display.print(c);
    Serial.print(c); 
  }
      
  }
  
 

# include<Wire.h>
String a;
void setup()
{
  Wire.begin(2);
  Wire.onRequest(send);
  a="Hai master";
}

void send()
{

    Wire.print(a);
      
}
void loop()
{
}

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.