Cannot find <LiquidCrystal_SoftI2C.h> library for 1602 LCD

Hi everyone,

I'm working on a project with an Arduino Uno and a 1602 I2C LCD. I need to use software I2C to control the LCD on digital pins 9 (SDA) and 8 (SCL), as the standard I2C pins are already in use.

My sketch requires the <LiquidCrystal_SoftI2C.h> and <SoftI2CMaster.h> libraries. I was able to find and install SoftI2CMaster, but I can't find a working version of LiquidCrystal_SoftI2C.h in the Arduino Library Manager or via Google.

When I try to compile, I get this error:

fatal error: LiquidCrystal_SoftI2C.h: No such file or directory compilation terminated.

Here is my full code:

#include <SoftI2CMaster.h>
#include <LiquidCrystal_SoftI2C.h>

LiquidCrystal_SoftI2C mylcd(0x27,16,2,9,8);

float checkdistance_4_3() {
  digitalWrite(4, LOW);
  delayMicroseconds(2);
  digitalWrite(4, HIGH);
  delayMicroseconds(10);
  digitalWrite(4, LOW);
  float distance = pulseIn(3, HIGH) / 58.00;
  delay(10);
  return distance;
}

void setup(){
  mylcd.init();
  mylcd.backlight();
  pinMode(4, OUTPUT);
  pinMode(3, INPUT);
}

void loop(){
  mylcd.setCursor(0, 0);
  mylcd.print(String(checkdistance_4_3()) + String("  cm"));
  mylcd.setCursor(0, 1);
  mylcd.print("");
  mylcd.clear();
  delay(100);
}

Could anyone please help me find where to download the correct LiquidCrystal_SoftI2C.h library? Or, is there a better, more current library for controlling an I2C LCD on custom pins?

Thanks in advance for your help!

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming category of the forum

Exactly which type of Uno board are you using ? On the classic board SDA is on pin A4 and SCL is on pin A5

thank you. I'm not used to here yet!

I use UNOR3. However, I only have to use the designated pins because there are situations where I have to run on a compatible board. It's too much to fix the hardware design! I've seen it run on the Internet with the same code as me a few times, but I couldn't find the library

1 Like

How hard did you look ?

yes , but it doesn't work...
for example, it doesn't have class LiquidCrystal_SoftI2C, so i changed name as LiquidCrystal_I2C! and i changed other things' name
But another problem occured. like this

      : : [SCLIN] "I" (SCL_IN), [SCLPIN] "I" (SCL_PIN));
                       ^~~~~~

so...I'm not sure if the library is right

thank you

oh ! I tried the example of that library and found it working. But I feel that the current code needs to be modified. I'll work on it well. I'm impressed with your kind effort. Thanks

Forget your code for now. Do the examples that come with the LiquidCrystal_SoftI2C compile OK

1 Like