Simon Ford
/
RN42-HID_HelloWorld
RN-42 Hello World experiments
Revision 0:0ca40ec83ec9, committed 2012-05-27
- Comitter:
- simon
- Date:
- Sun May 27 07:32:52 2012 +0000
- Commit message:
- First simple terminal access program for RN-42
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 0ca40ec83ec9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 27 07:32:52 2012 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +Serial RN42(p9, p10); +Serial pc(USBTX, USBRX); + +DigitalOut RN42_led(LED1); +DigitalOut pc_led(LED2); + +int main() { + + RN42.baud(115200); + pc.baud(115200); + + while(1) { + if(pc.readable()) { + RN42.putc(pc.getc()); + pc_led = !pc_led; + } + if(RN42.readable()) { + pc.putc(RN42.getc()); + RN42_led = !RN42_led; + } + } +}
diff -r 000000000000 -r 0ca40ec83ec9 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 27 07:32:52 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479 \ No newline at end of file