by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

main.cpp

Committer:
robt
Date:
2013-06-16
Revision:
0:49c6be914a81

File content as of revision 0:49c6be914a81:

/* Program Example 12.1: Bluetooth serial test data program
                                                                  */
#include "mbed.h"
Serial rn41(p9,p10);
BusOut led(LED4,LED3,LED2,LED1);

int main() {
  rn41.baud(115200);     // set baud for RN41
  while (1) {
    for (char x=0x30;x<=0x39;x++){  // ASCII numerical characters 0-9
      rn41.putc(x);                 // send test char data on serial
      led = x & 0x0F;               // set LEDs to count in binary
      wait(0.5);
    }
  }
}