#include <SoftwareSerial.h>
SoftwareSerial HC06(2,3);
void setup()
{
HC06.begin(9600);
Serial.begin(9600);
}
void loop()
{
if (HC06.available()) {
Serial.write(HC06.read());
}
if (Serial.available()) {
HC06.write(Serial.read());
}
}
// HC-06 Bluetooth Module Connection: TX = 2, RX =3, and 5 V / GND
// In Arduino IDE Serial Monitor, set 'No Line Ending'
// Enter 'AT' to get 'OK' response, then
// Enter 'AT+NAMEBT1234' to set HC-06 Module Name to 'BT1234'
// Enter 'AT+PIN1234' to set HC-06 Module PIN to '1234'
// Recommended Smartphoe App for connection is
// Arduino Bluetooth Control by broxcode