Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BluetoothBee.cpp
00001 //BluetoothBee.cpp 00002 00003 #include"BluetoothBee.h" 00004 #include "mbed.h" 00005 00006 #define WAIT_TIME 2 // wait time; you may need to increase this number for higher reliability (but slower) 00007 00008 BluetoothBee::BluetoothBee(PinName tx, PinName rx) :Serial(tx,rx) {} 00009 00010 void BluetoothBee::setup() { 00011 baud(115200); // the Bluetooth Bee defaults to 38400 baud, 8N1 (8 data bits, no parity, 1 stop bit) 00012 // mbed defaults to 9600 8N1; thus, change baud rate to 38400 00013 printf("\r\n+STWMOD=0\r\n"); // set as slave mode 00014 wait(WAIT_TIME); 00015 printf("\r\n+STNA=Microbots\r\n"); // set device name as "BluetoothBee" 00016 wait(WAIT_TIME); 00017 printf("\r\n+STOAUT=1\r\n"); // allow devices to connect to module 00018 wait(WAIT_TIME); 00019 printf("\r\n+INQ=1\r\n"); // start broadcasting (make device visible) 00020 wait(WAIT_TIME); 00021 }
Generated on Mon Jul 25 2022 12:31:47 by
1.7.2