// Write a program to interface LCD and Bluetooth module, to exhibit the values received
from mobile handset via Bluetooth on LCD.
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
// Set up the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
// Set up SoftwareSerial for Bluetooth communication
SoftwareSerial bluetooth(10, 11); // RX, TX pins for Bluetooth module
void setup() {
// Start the LCD and Bluetooth
lcd.begin(16, 2);
bluetooth.begin(9600);
// Display a welcome message on the LCD
lcd.print("Bluetooth LCD");
lcd.setCursor(0, 1);
lcd.print("Data: ");
delay(2000);
lcd.clear();
}
void loop() {
// Check if there is data available from the Bluetooth module
if (bluetooth.available() > 0) {
// Read the incoming data
char data = bluetooth.read();
// Display the received data on the LCD
lcd.setCursor(6, 1); // Set cursor to the second line
lcd.print(data);
}
}