Hi, I'm trying to set up my Bluetooth HC-05 but I'm having problems. I am using an Arduino Uno and I connect the bluetooth TX and RX cables to 0 and 1 of the Arduino. The code I am using is the following:
#include <SoftwareSerial.h> // Incluimos la librería SoftwareSerial
SoftwareSerial BT(0,1); // Definimos los pines RX y TX del Arduino conectados al Bluetooth
void setup()
{
Serial.begin(9600); // Inicializamos el puerto serie
BT.begin(38400); // Inicializamos el puerto serie BT (Para Modo AT 2)
Serial.println("Introduzca un comando:");
}
void loop()
{
if(BT.available()) // Si llega un dato por el puerto BT se envía al monitor serial
{
Serial.write(BT.read());
}
if(Serial.available()) // Si llega un dato por el monitor serial se envía al puerto BT
{
BT.write(Serial.read());
}
}
The problem comes when I open the serial monitor to send AT commands but I do not receive the correct message, I receive the following image.
https://drive.google.com/file/d/1StjO7i8S_lsV39meM8L2SeVMe-TT-ZPb/view?usp=sharing
I first show a message but when I enter the AT command, instead of receiving OK I receive xxxo. I suppose it is due to the bauds but I do not know how to put them, because the bluetooth I use was left to me and apparently it is already configured and I want to make changes, but it does not show me AT messages in a visible way.