wireless debugging via Bluetooth Bee module wiki: http://mbed.org/cookbook/Wireless-Debugging-with-Bluetooth-Bee
Diff: BluetoothBee.cpp
- Revision:
- 1:c249137509e7
- Parent:
- 0:4e1c16dddbad
- Child:
- 2:0c8cd82a5a45
--- a/BluetoothBee.cpp Fri Mar 30 18:55:57 2012 +0000 +++ b/BluetoothBee.cpp Fri Mar 30 19:39:58 2012 +0000 @@ -1,21 +1,21 @@ -//BluetoothBee.cpp - -#include"BluetoothBee.h" -#include "mbed.h" - -#define WAIT_TIME 2 // wait time; you may need to increase this number if establishing communication keeps failing - -BluetoothBee::BluetoothBee(PinName tx, PinName rx) :Serial(tx,rx) {} - -void BluetoothBee:: setup() { - baud(38400); // the Bluetooth Bee defaults to 38400 baud, 8N1 (8 data bits, no parity, 1 stop bit) - // mbed defaults to 9600 8N1; thus, change baud rate to 38400 - printf("\r\n+STWMOD=0\r\n"); // set as slave mode - wait(WAIT_TIME); - printf("\r\n+STNA=BluetoothBee\r\n"); // set device name as "BluetoothBee" - wait(WAIT_TIME); - printf("\r\n+STOAUT=1\r\n"); // allow devices to connect to module - wait(WAIT_TIME); - printf("\r\n+INQ=1\r\n"); // start broadcasting (make device visible) - wait(WAIT_TIME); +//BluetoothBee.cpp + +#include"BluetoothBee.h" +#include "mbed.h" + +#define WAIT_TIME = 2; // wait time; you may need to increase this number for higher reliability (but slower) + +BluetoothBee::BluetoothBee(PinName tx, PinName rx) :Serial(tx,rx) {} + +void BluetoothBee:: setup() { + baud(38400); // the Bluetooth Bee defaults to 38400 baud, 8N1 (8 data bits, no parity, 1 stop bit) + // mbed defaults to 9600 8N1; thus, change baud rate to 38400 + printf("\r\n+STWMOD=0\r\n"); // set as slave mode + wait(WAIT_TIME); + printf("\r\n+STNA=BluetoothBee\r\n"); // set device name as "BluetoothBee" + wait(WAIT_TIME); + printf("\r\n+STOAUT=1\r\n"); // allow devices to connect to module + wait(WAIT_TIME); + printf("\r\n+INQ=1\r\n"); // start broadcasting (make device visible) + wait(WAIT_TIME); } \ No newline at end of file