Dependencies: mbed-src
Fork of ex7_Bluetooth_HC-06_CMD by
main.cpp
- Committer:
- robertchoi
- Date:
- 2017-10-17
- Revision:
- 1:b976dec64b41
- Parent:
- 0:a4c1f76c9564
- Child:
- 2:f2444ffbc022
File content as of revision 1:b976dec64b41:
#include "mbed.h" Serial pc(USBTX, USBRX); Serial bt(D1, D0); int main(void) { char ch; pc.baud(9600); bt.baud(9600); pc.printf("Hello World! HC-06 bluetooth example...\n\r"); while(1) { if(bt.readable()) { ch=bt.getc(); pc.printf("%c",ch); } else if(pc.readable()) { ch=pc.getc(); bt.printf("%c",ch); } } }