Bluetooth.begin clashing with LCD.begin

#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#define Display 10

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
SoftwareSerial Bluetooth (3, 4); //Setting 3 and 4 as TX & RX
char Incoming_value = 0;

void setup() 
{
  //lcd.begin(16, 2)
  Serial.begin(9600);
  Bluetooth.begin(9600);
  pinMode(10, OUTPUT); //Display
}

void loop() 
{
  if (Bluetooth.available() > 0)
  {
    Incoming_value = Bluetooth.read();

    if (Incoming_value == '1')
    {
      digitalWrite(10, HIGH);
    }
    else if (Incoming_value == '0')
    {
      digitalWrite(10, LOW);
    }
  }
}

Dear mates, when I tried to run the above code where lcd.begin(16,2) is included, the bluetooth is not responding; therefore no code is executed.
But when I remove lcd.begin(16,2), the bluetooth works fine and able to power up and power down the LCD. The problem is I will have a blank display on the LCD; just power up but empty.

I’m using Arduino Uno, HC-05, LCD with I2C.

Thank you.

Are you using an Arduino Leonardo?
If so, see the Leonardo pinout diagram to avoid pin collision with the i2c pins:

--- bill

Hi, thanks for the reply.

Have figured it out. The lcd.begin should be in the void loop instead of void setup. Thanks again. =)

Have figured it out. The lcd.begin should be in the void loop instead of void setup. Thanks again. =)

You have not found the root cause of the issue. lcd.begin() does belong in setup, and invoking it every pass through loop is more likely a clue than a solution.