hc 05 bluetooth connection

I’ve been working in a project involving bluetooth, but for the last two weeks i’ve been having some trouble. I am using an Arduino Leonardo (pro micro). Searching on how to configure it, I’ve come to this code:
#include <SoftwareSerial.h>

SoftwareSerial BTSerial(1, 0); // RX | TX

void setup(){
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
Serial.println(“Enter AT commands:”);
BTSerial.begin(38400); // HC-05 default speed in AT command more

void loop(){

// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())

// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())

The problem i have is that when i am on the serial screen, i enter the first AT command so i enter AT, and it should answer OK, but i get no answer.

Thanks if you can help

Probably because you are nominating the hardware serial pins as software serial. The code is junk. You might find something useful by somebody who knows what he is doing on the Martyn Currey website.

I believe that things are a bit unusual with the Leo in this arena.

Serial works the serial monitor on the USB port in the normal manner

The hardware serial port on pins 0,1 is run by Serial1

Thus there is no need to use software serial, and you simply use Serial1 instead of BTSerial. Check this out.

Your wiring may be OK but note that many HC-05s are on a backboard that has a little pushbutton which makes the configuration a little easier. Currey has details on this.

Thanks, I’ll check that