Bluetooth Bee not taking commands(solved), and baudrate problem(not solved).

The Arduino microcontroller is connected to the bluetooth bee throught Rx and Tx.
The microcontroller is programmed to send and recieve characters.
When I connect directly to the microcontroller using my computer, I get the correct Serial.println(…). But why must I lower the hyperterminal to baudrate at 4800 too see the correct characters? When hyperterminal is at baudrate 9600, I get some random “symbols”.

When using bluetooth from my computer to connect to the bluetooth bee, only baudrate at 19200 works, but why?..otherwise I get the same “symbol” output problem.

The other problem is that the bluetooth bee doesn’t seems to take commands from my computer’s hyperterminal.

For example I send a character “a” from my hyperterminal to the bluetooth bee and the microcontroller is supposed to execute an operation: while(mySerial.read() == ‘a’) then do something.

But the bluetooth bee just keep outputting the old mySerial.print(…) and Serial.print(…)

below is the code with a little modification:

#include <SoftwareSerial.h>
#define RxD 11
#define TxD 12
 
SoftSerial mySerial(RxD,TxD);
 
void setup() 
{ 
    Serial.begin(9600);
    mySerial.begin(19200);
    pinMode(RxD, INPUT);
    pinMode(TxD, OUTPUT);
}

void loop()
{

Serial.println("Wired connection OK");
delay(1000);
mySerial.println("Bluetooth connection OK");
delay(1000);

while(mySerial.read() == 'a')
{
Serial.println("BBee input works");
mySerial.println("BBee input works");
}


}
SoftSerial mySerial(RxD,TxD);

SoftSerial? What library are you using? What version of the IDE?

For example I send a character "a" from my hyperterminal to the bluetooth bee and the microcontroller is supposed to execute an operation: while(mySerial.read() == 'a') then do something.

Why are you using while? That should be if!

PaulS:

SoftSerial mySerial(RxD,TxD);

SoftSerial? What library are you using? What version of the IDE?

For example I send a character "a" from my hyperterminal to the bluetooth bee and the microcontroller is supposed to execute an operation: while(mySerial.read() == 'a') then do something.

Why are you using while? That should be if!

Never mind, solved with the code mySerial.available

But any clue about the baudrate?