Need help with my code ASAP

#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>

#include <Wire.h>

hd44780_I2Cexp lcd(0x27, 16, 2); // Change the I2C address if necessary

const int trigPin = 2;
const int echoPin = 3;

void setup() {
lcd.begin(); // Initialize the LCD
lcd.backlight();
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
lcd.setCursor(0, 0);
lcd.print("Distance: ");
}

void loop() {
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);
distance = duration * 0.0343 / 2; // Speed of sound in cm/ms

lcd.setCursor(0, 1); // Set the cursor to the second line
lcd.print(" "); // Clear any previous distance value
lcd.setCursor(0, 1); // Set the cursor to the second line
lcd.print(distance);
lcd.print(" cm");

delay(500); // Update the display every half second

Problem in 6th line not working

Can someone please make me a new code or help me with the same code please

Please post your sketch, using code tags when you do. This prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help

What does this mean exactly ?

How is it "not working" ?

Read the documentation for pulseln and see what is returned if there is NO ECHO after a one second wait.

That only tells the compiler that trigPin is pin number 2, it does nothing else.

Your problem is not unexpected, and your wiring may be the root cause. Since hardware is involved, it’s crucial to provide an accurate, annotated schematic of your circuit as it is currently wired. Please note that Fritzing diagrams are not considered proper schematics; they are wiring diagrams and are often not helpful for troubleshooting.

What to Include:

  1. Annotated Schematic: Show all connections, including power, ground, and power sources. This helps us understand how your circuit is set up and identify any potential issues.
  2. Technical Information Links: Provide links to technical documentation for each hardware device used in your setup. Avoid links to sales sites like Amazon, as they usually lack the necessary technical details. We need complete specifications to help you effectively.
  3. Additional Information Needed: If the above details are incorrect, more information is required. Tell us what hardware and software you are using, the format of any data (like map data), and how your system determines its position. For example, if your project involves a robot, describe how it navigates and what computers are involved.

Why This Matters:

We have no way of knowing the specifics of your setup unless you provide that information. Clear and detailed descriptions enable us to offer the most accurate help possible. Without these details, it’s difficult to diagnose and solve the issues you're experiencing.

@problemmaker
The code you have posted will not compile.
I would suggest you spend a bit of time looking over the hd44780 library and hd44780_I2Cexp i/o class documentation and then looking at the included hd44780_I2cexp i/o class examples to see what header files to include in what order, how to declare the lcd object, and how to initialize the lcd device.

The library comes with extensive documentation down under the Documentation sketch that can be accessed directly from the Arduino IDE.

There is also a wiki on the github repository.
Here is a link to the hd44780 library wiki:
https://github.com/duinoWitchery/hd44780/wiki

And a direct link to the hd44780_I2Cexp i/o class wiki:
https://github.com/duinoWitchery/hd44780/wiki/ioClass:-hd44780_I2Cexp

--- bill

The command

lcd.begin(); // Initialize the LCD is terminated by Arduino IDE Software

Copied error messages given below

FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for LCD-I2C.h: [LCD-I2C@1.0.0]
ResolveLibrary(LCD-I2C.h)
-> candidates: [LCD-I2C@1.0.0]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
-> candidates: [Wire@1.0]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for LCD_BacklightRGB.h: [LCD_BacklightRGB@1.1.3]
ResolveLibrary(LCD_BacklightRGB.h)
-> candidates: [LCD_BacklightRGB@1.1.3]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for DFRobot_RGBLCD1602.h: [DFRobot_RGBLCD1602@2.0.1]
ResolveLibrary(DFRobot_RGBLCD1602.h)
-> candidates: [DFRobot_RGBLCD1602@2.0.1]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for LiquidCrystal.h: [LiquidCrystal@1.0.7 LiquidCrystal@1.0.7]
ResolveLibrary(LiquidCrystal.h)
-> candidates: [LiquidCrystal@1.0.7 LiquidCrystal@1.0.7]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for LiquidCrystal_I2C.h: [LiquidCrystal_I2C@1.1.4]
ResolveLibrary(LiquidCrystal_I2C.h)
-> candidates: [LiquidCrystal_I2C@1.1.4]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src\LCD-I2C.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\Wire.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\utility\twi.c -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src\Colors.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src\LCD_BacklightRGB.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602\DFRobot_RGBLCD1602.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src\LiquidCrystal.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C\LiquidCrystal_I2C.cpp -o nul
Generating function prototypes...
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602 -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o C:\Users\risha\AppData\Local\Temp\4195450229\sketch_merged.cpp
C:\Users\risha\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\risha\AppData\Local\Temp\4195450229\sketch_merged.cpp
Compiling sketch...
"C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C\src" "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB\src" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal\src" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C" "C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp" -o "C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp.o"
C:\Users\risha\Downloads\distance_meter\distance_meter.ino: In function 'void setup()':
C:\Users\risha\Downloads\distance_meter\distance_meter.ino:22:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
lcd.begin();
^
In file included from C:\Users\risha\Downloads\distance_meter\distance_meter.ino:10:0:
c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^~~~~
c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided
Multiple libraries were found for "LiquidCrystal.h"
Used: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal
Not used: C:\Users\risha\AppData\Local\Arduino15\libraries\LiquidCrystal
Using library LCD-I2C at version 1.0.0 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD-I2C
Using library Wire at version 1.0 in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Using library LCD_BacklightRGB at version 1.1.3 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LCD_BacklightRGB
Using library DFRobot_RGBLCD1602 at version 2.0.1 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\DFRobot_RGBLCD1602
Using library LiquidCrystal at version 1.0.7 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal
Using library LiquidCrystal_I2C at version 1.1.4 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C
exit status 1

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

Sir @bperrybap PLS HELP ME

I have that library (hd44780) and it is also included in the code pls I need help asap @bperrybap

-Problemmaker

Sir I forgot to tell I m new at Arduino Software and also I lack of Experience

I m making a Distance Meter

Components used-Breadboard, LCD Display 16*2, Ultrasonic Sensor Model HC-SR04, Arduino Uno and Jumper Wires Pls help ASAP

Still the lcd.begin() command isnt working I need help @bperrybap

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Please post your full sketch, using code tags when you do. This prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

I m sorry for not using code tags. I read the advice. I apologies for the inconvenience caused by me.

Here is the Code

#include <jm_LiquidCrystal_I2C.h>
#include <jm_Scheduler.h>
#include <jm_Wire.h>

#include <LiquidCrystal_I2C.h>

#include <Wire.h>

#include <LiquidCrystal_74HC595.h>

#include <LCD-I2C.h>

#include <LCD_BacklightRGB.h>

#include <DFRobot_RGBLCD1602.h>

#include <LiquidCrystal.h>

#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
}

It looks like you have created a mess.
You have put header files for multiple LCD libraries in your code.
You don't want to do that. That can and often does create issues.
Adding more header files to your code is not the answer. You should only include the header files for the libraries(s) you are actually wanting to use and they need to be in the proper order.

The header files you have used are for libraries that are not all for the same type of LCD device. Again, you don't want to do this.
In fact some of these libraries may have conflicting header files and shouldn't really be installed at the same time because it can create issues due to the way the IDE locates header files when building your code.

Your main issue is that you have put multiple header files for multiple LCD libraries in your code and you code is not using the correct API for any of them.
You need to pick one LCD library and then fix your code to properly use that library.

My suggestion, is

  • pick one and only one LCD library.
  • go read the documentation for that LCD library
  • get one of its minimal examples working. (i.e. perhaps HelloWorld etc...)
    Then look at the documentation and that example to see how to use the selected library.

It isn't clear what LCD device and interface you actually have.

If you have a hd44780 type LCD with a PCF8574 based backpack,
I would suggest that you use the hd44780 library - see my previous post, post #6
The hd44780 library would be my recommendation because there will be no issues with conflicts with any other LCD library. This is not the case for some of the other libraries you have have attempted to use.
The hd44780_I2Cexp i/o class in the hd44780 library also comes with a diagnostic tool, I2CexpDIag, to check things out to make sure everything is working properly. No other LCD library has anything like that.

If you don't want to use the hd44780 library then my other recommendation would be use the LiquidCrystal_I2C library.
But given that library can have conflict issues with other LCD libraries, I would recommend that you uninstall this library and any of the other LCD libraries you are not needing to use and then install LiquidCrystal_I2C from the IDE library manager (not from a zip file) just to make sure everything is cleanly installed.

Unfortunately, uninstalling libraries is a total PITA because for some odd reason the Arduino dev team doesn't want to allow removing libraries from the IDE.
They have fought adding support to do this in the IDE for well over 10 years.
So the only way to uninstall libraries is to manually uninstall them using the operating system file manager and for less technical users, this can be an issue.
Another reason why I recommend using the hd44780 library as with that library you don't need to worry about library conflicts so you don't ever have to remove another library to use it.

You could consider to clean up this ugly post by putting the error messages into code tags as well. You can edit any of your own posts!

Additional info needed:

  • Detailed information on esp the LCD display module
  • Schematic and/or wiring diagram
  • Clear photos of how you have everything wired up.
  • A clear description of what 'isnt working' entails.

"Pls ASAP" and all that.

Also, I'd recommend starting with ONLY the Arduino and the LCD and trying to get it to print Hello World. If that works, start adding the other components one by one.

Also, see the advice of @bperrybap concerning libraries. You need only a single library for the LCD.

Thanks! I will Try the given options By Sir @bperrybap, and Sir @rsmls

#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
}

Above is my new code. I only used LiquidCrystal_I2C.h library and Wire.h library. But its not working same error.

Copied error Messages below: -

FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
-> candidates: [Wire@1.0]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
Alternatives for LiquidCrystal_I2C.h: [LiquidCrystal_I2C@1.1.4]
ResolveLibrary(LiquidCrystal_I2C.h)
-> candidates: [LiquidCrystal_I2C@1.1.4]
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\Wire.cpp -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\utility\twi.c -o nul
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C\LiquidCrystal_I2C.cpp -o nul
Generating function prototypes...
C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp -o C:\Users\risha\AppData\Local\Temp\3249917967\sketch_merged.cpp
C:\Users\risha\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\risha\AppData\Local\Temp\3249917967\sketch_merged.cpp
Compiling sketch...
"C:\Users\risha\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src" "-Ic:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C" "C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp" -o "C:\Users\risha\AppData\Local\Temp\arduino\sketches\20726A9BD3AE407C7293A47022FFA56B\sketch\distance_meter.ino.cpp.o"
C:\Users\risha\Downloads\distance_meter\distance_meter.ino: In function 'void setup()':
C:\Users\risha\Downloads\distance_meter\distance_meter.ino:12:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
lcd.begin();
^
In file included from C:\Users\risha\Downloads\distance_meter\distance_meter.ino:2:0:
c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^~~~~
c:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided

Using library Wire at version 1.0 in folder: C:\Users\risha\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Using library LiquidCrystal_I2C at version 1.1.4 in folder: C:\Users\risha\Downloads\New folder\LiquidCrystal_I2C-master\libraries\LiquidCrystal_I2C
exit status 1

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

What should I do

Try Time Eckel's NewPing library.
https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home