Hey dear community,
I am a futur embeded enginneer and I was working on an arduino project with hc05 bluetooth module when I had a serious issue with it.
I am using on one hand, an arduino UNO board with a HC05 bluetooth module connected to it and on another hand I am using HC05 Bluetooth Terminal APP,
In fact, the problem is that when I want to print a character sent by the Bluetooth terminal on arduino's serial monitor, I get garbage characters that don't even belong to the ASCII table.
Here is my code:
#include <SoftwareSerial.h>
//Declaration of variables:
SoftwareSerial Bluetooth(2,3);//the bluetooth object
//Bluetooth(RX_pin,TX_pin);
char c =' ';
void setup() {
Serial.begin(9600);
Serial.println("ready");
Bluetooth.begin(38400);
}
void loop() {
if(Bluetooth.available())
{
c = Bluetooth.read();
Serial.write(c);
}
if(Serial.available())
{
c = Serial.read();
Bluetooth.write(c);
}
}
Here is the display I have on the serial monitor:
And that happened when I sent the caracter 'c' from the HC05 Bluetooth terminal APP