Electronic – arduino – Seeedstudio Bluetooth Bee

arduinobluetooth

I'm looking to interface a Seeedstudio Bluetooth Bee with an Android phone for a project, and I want to get the Arduino code down pat.

Specifically, I want to be able to set the time over Bluetooth (which will then interface to a RTC module), then receive RFID strings over the Bluetooth module.

There is a side issue, and thats whether all my NewSoftSerial stuff will play nicely – an exercise for me later, once I have the Bluetooth working.

The code set out by Seeedstudio is helpful, but not complete enough to explain to me. I have a moderate knowledge of Bluetooth, but I'm not afraid to ask questions. Hopefully, I can get the Bluetooth side of things to play "nice" so I can concentrate on the NewSoftSerial issue.

Here is some of the code I'm using to initialise the Bluetooth Bee, and I'm hoping I can then pair the Bee with the phone, and transfer data using the serial profile.

Serial.print(“\r\n+STWMOD=1\r\n”);

Serial.print(“\r\n+STNA=modem”);

Serial.print(“\r\n+RTPIN=0000\r\n”);

delay(2000);

Serial.print(“\r\n+INQ=1\r\n”);

delay(2000);

Serial.print(“\r\n+STBD=9600″);

I guess, what I'm asking for is the process of connection – on Seeedstudios forum once the +INQ=1 command is issued, then the phone (or computer) can find the Bee. As you can see, I have an RTPIN of "0000" (secure, I know…) so inputing that into the phone will pair the phone and Bee? Or am I way off the mark?

Many thanks.

Shane.

Best Answer

I found some example code on a website, this fellow is doing almost exactly what I'm doing, just the information is going from phone to Arduino, not Arduino to phone.

All the code is downloadable, and I've checked it out - I'm going to try the PDE, and see if I can connect from my Mac and U8300.

It also includes constructs for the code I need on the phone side, which was going to be my next question after this one - two for the price of one!

http://ai.kittywolf.net/index.php/BTArduinoLED1

Have a look, its said in the description that (paraphrase) "the initialisation sequence must be done right..." so I can now use this code as a guide.

Hope this helps!

Shane.