It took me quite a bit of time and research to determine how to set up my Bluetooth Bee/XBee Shield combo. I found this article at the Seeed Studio site and followed it to get to the setup I am using now.
I created one sketch to configure the BT Bee as I wanted it and a template for using it within my apps. The first sketch below is the done once to configure the BT Bee for later use. It is very similar to the code in the article above except that I used pins 0/1 for RX/TX instead of the NewSoftSerial library. Because of that, though, I have to remove the BT Bee, upload the sketch, then reinstall the BT Bee and it will be configured after power is applied to the Arduino. I’m willing to put up with that because it only needs to be done once for an individual BT Bee.
The second sketch is a template of how to incorporate BT Bee communications into a application sketch. Basically, after the configuration is completed, only the “INQ” command is needed to initiate pairing with your other bluetooth device. I anticipated always using my Arduino/BT Bee in slave mode so the configuration sketch reflects that choice.
