Can somebody explain to me the differences between using the hardware serial option vs. the software serial option? The tutorials from the Wiki only use the software serial port. I am wondering if there are any advantages or disadvantages to using either of them.
Why if the default baud rate is 38400, do the examples in the Wiki monitor the serial port at 9600 baud? I got the shield set up and connected to my PC and it is definitely running at 9600 baud, and not 38400. So what is the command:
blueToothSerial.begin(38400);
actually doing, since it doesn’t seem to be setting the baud rate to 38400. How do I raise the baud rate to 115200, since the “blueToothSerial.begin” command does not seem to set the baud rate.
Hi ~
In the demo code, software serial is for communication with Bluetooth Shield, hardware serial is for communication with serial port of computer.
The default baud rate of Bluetooth Shiled is 38400, so we set the software serial baud rate to 38400 with the code blueToothSerial.begin(38400);
Hardware serial baud depend on what is the baud rate of your monitor, default to use 9600 when you open monitor of Arduino IDE.
More informations about Software Serial , see the documentation on Arduino offical website.http://arduino.cc/en/Reference/SoftwareSerial
Are there any examples available of how to use hardware serial for the BT Shield? There doesn’t seem to be a way to get software serial to work above 38400 baud, which isn’t fast enough for a lot of applications.
We don’t have it at present , but it is easy to write it based on the software serial code, it will be helpful for you to study Arduino programming, for Serial function you could refer to (arduino.cc/en/Reference/Serial)
For anyone who might be coming to the forum looking for some help, the key to connecting the bluetooth shield using hardware serial on the Arduino Uno (and getting baud rates greater than 38400) is to unplug the shield (or at least the jumpers) upload the program, then plug it in again. The jumpers need to be plugged into TX->0 and RX->1, but trying to upload the program while jumpers are plugged in will cause a sync error. Also, it’s necessary to call .begin at the baud rate the shield is currently set at, then call, for example,
Serial.print("\r\n+STBD=57600\r\n");
then modify the code to call begin at 57600, comment out the STBD line, and re-upload