by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Revision 0:5775e366c477, committed 2013-06-16
- Comitter:
- robt
- Date:
- Sun Jun 16 15:28:59 2013 +0000
- Commit message:
- by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 5775e366c477 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jun 16 15:28:59 2013 +0000 @@ -0,0 +1,17 @@ +/* Program Example 12.2: Bluetooth serial sniffer program + */ +#include "mbed.h" +Serial rn41(p9,p10); +BusOut led(LED4,LED3,LED2,LED1); + +int main() { + rn41.baud(115200); // setup baud rate + rn41.printf("Serial sniffer: outputs received data to LEDs\n\r"); + while (1) { + if (rn41.readable()) { // if data available + char x=rn41.getc(); // get data + led=x; // output LSByte to LEDs + } + } +} +
diff -r 000000000000 -r 5775e366c477 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jun 16 15:28:59 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file