Here is my test code for a HC05 Bluetooth module and the Bluetooth serial terminal. Adjust the pins as necessary for your setup. Use this simple code to make sure the Bluetooth module is connected and working.
//Sends from serial monitor to the Bluetooth device app
// receives from the Bluetooth device app
#include <SoftwareSerial.h>
SoftwareSerial BTserial(4, 7); // pin 4 to BT TX, pin 7 to BT RX
// through voltage divider
void setup()
{
Serial.begin(9600);
Serial.println("Bluetooth test program");
BTserial.begin(9600);
BTserial.println("Bluetooth test program");
}
void loop()
{
if (Serial.available())
{
BTserial.write(Serial.read());
}
if (BTserial.available())
{
Serial.write(BTserial.read());
}
}