No matching function for call to 'LiquidCrystal_I2C::begin()' [begin/init mixed]

can someone help me? i don't know how to solve it
the error code is

no matching function for call to 'LiquidCrystal_I2C::begin()'

the code then i am using is that

//Tech Trends Shameer
//Distance Measurement using Ultrasonic Sensor

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
#define trigPin 7 //Sensor Echo pin connected to Arduino pin 13
#define echoPin 6 //Sensor Trip pin connected to Arduino pin 12

void setup()
{
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  lcd.begin();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print("Tech Trends");
  delay(2000);
  lcd.setCursor(0,0);  //Set LCD cursor to upper left corner, column 0, row 0
  lcd.print("Target Distance:");  //Print Message on First Row
}

void loop()
{
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;

  lcd.setCursor(0,1);  //Set cursor to first column of second row
  lcd.print("                "); //Print blanks to clear the row
  lcd.setCursor(0,1);   //Set Cursor again to first column of second row
  lcd.print(distance); //Print measured distance
  lcd.print(" cm");  //Print your units.
  delay(250); //pause to let things settle
}

Look at the examples that come with the LiquidCrystal_I2C library that you use. Do those examples use lcde.begin or lcd.init or ... .

There are too many different LiquidCrystal_I2C libraries. And if you follow an program from the web, it might well have been written for a different library than the one you are using.

oh thanks dude

how i look at the examples that come with the LiquidCrystal_I2C library that i use?

how i look at the examples that come with the LiquidCrystal_I2C library that i use?

File > Examples then hover your mouse over the library in the list

thanks

1 Like