I have experience with communication over USB, and I looked at the official page for the Arduino BT, but I did not find any example sketches. Besides setting the baud rate to 115200, is communication via BlueTooth the same as with USB? I basically need to send a read command to the Arduino from the PC and send back sensor values.
Hi Buchacho,
the communication to the Arduino-BT is identical to an Arduino Duemilanove from a perspective of a PC. Both use virtual COM ports as communication endpoint.
On windows you have to use the following syntax for the port name: "\.\COM14" to use port numbers >9.
There is one difference for the Arduino-BT: you have to avoid to send data from the ATmega, when there is no bluetooth connection active, because the WT-11 bluetooth chip will crash when its receive buffer overflows.
MikeT
Hello Mike,
you said:
There is one difference for the Arduino-BT: you have to avoid to send data from the ATmega, when there is no bluetooth connection active, because the WT-11 bluetooth chip will crash when its receive buffer overflows.
It could be the reason for my connection problems !!
But how can BT check if there is bluetooth connection in order to prevent it to send data ?
Actually the connection between windows and BT auto stop after 15 seconds !!
So i can't send or receive any informations ...
Hi jml,
But how can BT check if there is bluetooth connection in order to prevent it to send data ?
You can use a request-response protocol where the Arduino-BT acts as a slave and only sends data, when the PC sends a command.
The other possibility is to use the hardware handshake lines of the WT-11 (CD, RTS) and connect them to I/O pins of the ATmega. Please look in the iWRAP manual (available at http://www.sparkfun.com/datasheets/Wireless/Bluetooth/iWRAP_2.2.0_User_Guide.pdf) for the "SET CONTROL CD" and "SET CONTROL MSC".
MikeT
Thank you Mike,
I think i will try to use the 1st solution because the second one seems to be quite difficult (and all the documentation is in english !)
even if it is surely more efficient...