Rob Toulson / Mbed 2 deprecated PE_12-01_BluetoothTest

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /* Program Example 12.1: Bluetooth serial test data program
00002                                                                   */
00003 #include "mbed.h"
00004 Serial rn41(p9,p10);
00005 BusOut led(LED4,LED3,LED2,LED1);
00006 
00007 int main() {
00008   rn41.baud(115200);     // set baud for RN41
00009   while (1) {
00010     for (char x=0x30;x<=0x39;x++){  // ASCII numerical characters 0-9
00011       rn41.putc(x);                 // send test char data on serial
00012       led = x & 0x0F;               // set LEDs to count in binary
00013       wait(0.5);
00014     }
00015   }
00016 }
00017