I2C LCD DISPLAYS WITH ARDUINO

Hello may someone help me to use i2c lcd to display my characters. and F2 is not displaying when i use LiquidCystal. I have tried to download i2c libraries and added in my code alone . It displays but stops at Connected…Device ready permanently L1 and L2 is not changing too. and does not display other characters as indicated in the code. What might be the problem? kindly help me by adjusting my code to display using i2c lcd… I want to use i2c and not other liquid crystal lcd.
here is the code
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(11,10);
LiquidCrystal lcd(3, 4, 5, 6, 7, 8);//LCD RS-3,En-4,D4-5,D5- 6,D6-7,D7-8

#define Turbidity A3
#define motorpump A4

const int trigPin1 = 12; // for raw water tank
const int echoPin1 = 13;// for raw water tank
const int trigPin2 = 9; // for clean water tank
const int echoPin2 = 14;// for clean water tank
long duration1,duration2;

int distanceCm1, distanceCm2;

unsigned long currentTime1;

unsigned long currentTime2;

volatile int NbTopsFan1; //measuring the rising edges of the signal

volatile int NbTopsFan2; //measuring the rising edges of the signal

int Flowrate1;

int Flowrate2;

int hallsensor1 = 20; //The pin location of the sensor1

int hallsensor2 = 2; //The pin location of the sensor2

float volt;

float ntu;

int x=0;//integer for sending sms once

void rpm () //This is the function that the interupt calls

{

NbTopsFan1++; //This function measures the rising and falling edge of the hall effect sensor1 signal

NbTopsFan2++; //This function measures the rising and falling edge of the hall effect sensor2 signal
}

void setup()

{

pinMode(motorpump, OUTPUT);

pinMode(trigPin1, OUTPUT);

pinMode(echoPin1, INPUT);

pinMode(trigPin2, OUTPUT);

pinMode(echoPin2, INPUT);

pinMode(hallsensor1, INPUT); //initializes digital pin 20 as an input

pinMode(hallsensor2, INPUT); //initializes digital pin 2 as an input

attachInterrupt(0, rpm, RISING); //and the interrupt is attached

lcd.begin (16,2);
Serial.begin(9600);//////////////////

lcd.setCursor(3,0);

lcd.print(“AUTOMATION”);

lcd.setCursor(4,1);

lcd.print(“CONTROL”);

delay(2000);
lcd.clear();

mySerial.begin(9600);
// Check if you’re currently connected to SIM800L
while(!mySerial.available()){
mySerial.println(“AT”);
delay(1000);
lcd.setCursor(0,0);
lcd.print(“connecting…”);
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Connected…”);
mySerial.println(“AT+CMGF=1”); //Set SMS Text Mode
delay(1000);
mySerial.println(“AT+CNMI=1,2,0,0,0”); //procedure, how to receive messages from the network
delay(1000);
mySerial.println(“AT+CMGL=“REC UNREAD””); // Read unread messages
lcd.setCursor(0,1);
lcd.print(“DEVICE READY”);
delay(1000);

}

void loop(){

digitalWrite(trigPin1, LOW);

delayMicroseconds(5);

digitalWrite(trigPin1, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin1, LOW);

duration1 = pulseIn(echoPin1, HIGH);

distanceCm1= duration1*0.034/3;
lcd.setCursor(8,1);

lcd.print(“L1”);//distance 1

lcd.setCursor(10,1);

lcd.println(distanceCm1);///////

digitalWrite(trigPin2, LOW);

delayMicroseconds(5);

digitalWrite(trigPin2, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin2, LOW);

duration2 = pulseIn(echoPin2, HIGH);

distanceCm2= duration2*0.034/2;
lcd.setCursor(12,1);

lcd.print(“L2”);//Distance 2
lcd.setCursor(14,1);

lcd.print(distanceCm2);

NbTopsFan1 = 0; //Set NbTops to 0 ready for calculations

sei(); //Enables interrupts

delay (1000); //Wait 1 second

cli(); //Disable interrupts

Flowrate1 = (NbTopsFan1 * 60 / 5.5); //(Pulse frequency x 60) / 5.5Q, = flow rate in L/hour
lcd.setCursor(0,1);
lcd.print(“F1”);//Flowrate1
lcd.setCursor(2,1);
lcd.print (Flowrate1, DEC); //Prints the number calculated above

//Serial.println (" (F1)L/hour"); //Prints “L/hour” and returns a new line

NbTopsFan2 = 0; //Set NbTops to 0 ready for calculations

sei(); //Enables interrupts

delay (1000); //Wait 1 second

cli(); //Disable interrupts

Flowrate2 = (NbTopsFan2 * 60 / 5.5); //(Pulse frequency x 60) / 5.5Q, = flow rate in L/hour
lcd.setCursor(4,1);
lcd.print(“F2”);//Flowrate2
lcd.setCursor(6,1);
lcd.print (Flowrate2, DEC); //Prints the number calculated above

//Serial.println (" (F2)L/hour"); //Prints “L/hour” and returns a new line

if (distanceCm1<=10)

{

digitalWrite(motorpump, LOW);

lcd.clear();lcd.setCursor(0,0);

lcd.print(“P.ON”);

delay(1000);

lcd.clear();

lcd.setCursor(0,1); lcd.print(“FI”);//Rate1=

lcd.setCursor(2,1);lcd.print(Flowrate1);

lcd.setCursor(4,1);lcd.print(“FT”);//Rate2=

lcd.setCursor(6,1);lcd.print(Flowrate2);

delay(1000);

}

else

{

digitalWrite(motorpump, HIGH);

lcd.clear();lcd.setCursor(0,0);

lcd.print(“L. LOW”);
lcd.setCursor(0,0);

lcd.print(“BP OFF”);//Booster pump off

delay(1000);

sendmessage();

}

if(!(distanceCm1<=10 && Flowrate1<=100 && Flowrate2<=50 && !(distanceCm2<=5)))

{

lcd.clear();

lcd.setCursor(0,0);

lcd.print(“STM OK”);//system ok

delay(1000);

lcd.clear();

lcd.setCursor(0,1);lcd.print(“FI”);//Rate1=

lcd.setCursor(2,1); lcd.print(Flowrate1);

lcd.setCursor(4,1);lcd.print(“FT”);//Rate2=

lcd.setCursor(6,1);lcd.print(Flowrate2);

delay(1000);

lcd.clear();

lcd.setCursor(10,0);

lcd.print(ntu);

lcd.print(" NTU");

delay(1000);

}

if(distanceCm1<=10 && Flowrate1<=100 && !(distanceCm2<=5))

{

lcd.clear();lcd.setCursor(0,0);

lcd.print(“FBLOCKED”);//Filter Blocked!

delay(1000);

delay(250);

sendmessage1();

}

if(distanceCm1<=10 && Flowrate2<=50 && !(distanceCm2<=5))

{

lcd.clear();lcd.setCursor(0,0);

lcd.print(“M.BLOCKED!”);

delay(1000);

sendmessage2();

}

if(distanceCm2<=5)

{

lcd.clear();lcd.setCursor(0,0);

lcd.print(“FULL!”);

digitalWrite(motorpump, HIGH);

lcd.setCursor(0,1);

lcd.print(ntu);

lcd.print(" NTU");

}

}

float round_to_dp( float in_value, int decimal_place )
{

float multiplier = powf( 10.0f, decimal_place );

in_value = roundf( in_value * multiplier ) / multiplier;

return in_value;

}
void sendmessage()
{
mySerial.println(“AT+CMGF=1”); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println(“AT+CMGS=”+254791165704"\r"); // Replace x with mobile number
delay(1000);
mySerial.println(“Filter almost blocked”);// The SMS text you want to send
delay(100);
lcd.setCursor(0,1);
lcd.print(“sms sent”);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}
void sendmessage1()
{
mySerial.println(“AT+CMGF=1”); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println(“AT+CMGS=”+254791165704"\r"); // Replace x with mobile number
delay(1000);
mySerial.println(“Filter almost blocked”);// The SMS text you want to send
delay(100);
lcd.setCursor(0,1);
lcd.print(“sms sent”);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}
void sendmessage2()
{
mySerial.println(“AT+CMGF=1”); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println(“AT+CMGS=”+254791165704"\r"); // Replace x with mobile number
delay(1000);
mySerial.println(“Membrane almost blocked”);// The SMS text you want to send
delay(100);
lcd.setCursor(0,1);
lcd.print(“sms sent”);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

float turbidity()
{
volt = 0;

for(int i=0; i<800; i++)

{

volt +=((float)analogRead(Turbidity)/1023)*5;

}

volt = volt/800;

volt = round_to_dp(volt,1);

if(volt < 2.5){

ntu >=3000;

}
else{

ntu = -78.705*(voltvoltvolt) - 82.122square(volt) - 17.174volt + 3476.5;

}
return ntu;
}

Start by Auto formatting your code in the IDE and posting it here in code tags to make it more presentable (no smileys in it for one thing) and easy to copy and put into an editor for examination.

See read this before posting a programming question

may someone help me to use i2c lcd to display my characters

If you are using an LCD display connected using I2C then you are almost certainly using the wrong library. How is the LCD connected to the Arduino and where did you get the library ?

You have not told us what, exact, LCD that you are using, but I assume a character LCD with hd44780 controller. The library that you are using is for a parallel interface LCD, NOT I2C. So before I tell you how to get your LCD to work I must know what you have and how it is connected.

You obviously did not read the How to use this forum-please read sticky. Please take the time to read it now. It will save a lot of time if you follow the guidelines for posting code and supplying the required information.

Format your code with the auto format tool in the IDE (ctrl-t or Tools, Auto Format.
Remove useless white space. Extra blank lines makes the code harder to read.
Post code in code tags. That makes it much easier to copy to the IDE or other editor for examination.