This module provides a very simple way to replace a serial cable connection with a Bluetooth Serial Port Profile (SPP) connection.
As well has having a good set of features accessible via an AT-style command set, one great feature is that out of the box, it is configured to be a serial port host listening for an incoming serial port request. This means that immediately, without any configuration, you can pair the RN42 with a Bluetooth enabled computer, and have a 115200-8-N-1 serial connection
00001 #include "mbed.h" 00002 00003 Serial rn42(p9,p10); 00004 DigitalOut myled(LED1); 00005 00006 int main() { 00007 00008 rn42.baud(115200); 00009 00010 // echo back characters, toggle the LED 00011 while (1) { 00012 if (rn42.readable()) { 00013 rn42.putc(rn42.getc()); 00014 myled = !myled; 00015 } 00016 } 00017 }
| RN42 Pin | mbed Pin |
| 1 - GND | GND |
| 11 - VDD | Vout |
| 12 - GND | GND |
| 13 - RX | p9 |
| 14 - TX | p10 |
| 28 - GND | GND |
| 29 - GND | GND |
No tags
|
34 comments
Please login to post comments.
The RN41 or RN42 by it self is not easy to setup, because the internal application of Roving Networks has very poor performance and based on old 2007 firmware of CSR BlueCore4-Ext. I am also specialist in wireless bluetooth of CSR product.
So: If you want simple solution then I have product with simple control for Bluetooth. I am developed for RN42 and RN41 internal C application, which run on BlueCore4-Ext and it simplify the whole process. It based on the new 2009 firmware, where many bugs of Bluetooth was fixed. I am in process to develop simple PCBs. What I mean: You just need to send data to UART and enable one pin for data transmission. For incoming data you do not need to press anything, whatever Bluetooth receive it come to UART directly. There are others few pins: For pairing, baudrate setup and reset, as also indicator.
Regards, Stas