I have tried to connect my arduino with hc-05, and run a simple 'LED on and off' program. When I disconnected the rx and tx pins and tried sending the commands using serial monitor in arduino, and it worked perfectly alright. But when I connected the rx and tx pins of hc-05 bluetooth module, and used the Bluetooth terminal app from playstore to send and recieve commands, whatever I send doesn't get recieved the same, instead I get weird characters on my serial monitor. Someone please help me solve this. I have included the arduino code and the screen shots of the serial monitor and the app.
char junk;
String inputString="";
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available()){
while(Serial.available())
{
char inChar = (char)Serial.read();
inputString += inChar;
}
Serial.println(inputString);
while (Serial.available() > 0)
{ junk = Serial.read() ; }
if(inputString == "a"){
digitalWrite(13, HIGH);
}else if(inputString == "b"){
digitalWrite(13, LOW);
}
inputString = "";
}
}