Use Uart
Dependencies: mbed
Fork of Serial_HelloWorld_Mbed by
Revision 6:3689cb2a18f4, committed 2017-04-20
- Comitter:
- IOP
- Date:
- Thu Apr 20 09:28:30 2017 +0000
- Parent:
- 5:4e99dfae8dca
- Commit message:
- code update
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4e99dfae8dca -r 3689cb2a18f4 main.cpp --- a/main.cpp Thu Jan 07 00:02:17 2016 +0000 +++ b/main.cpp Thu Apr 20 09:28:30 2017 +0000 @@ -1,24 +1,15 @@ #include "mbed.h" -#if defined(TARGET_WIZwiki_W7500) -#define USBTX PC_2 -#define USBRX PC_3 -#endif - -Serial pc(USBTX,USBRX); +Serial pc(PC_02,PC_03); -int main() { - pc.baud(115200); // set baudrate +int main(){ + + pc.baud(115200); - pc.printf("Hello World!\n"); // string output + pc.printf("Hello World!\n"); - while(1) { - pc.putc(pc.getc()+1); // typing characters + while(1) + { + pc.putc(pc.getc()+1); } } - - - - - -