Use Uart
Dependencies: mbed
Fork of Serial_HelloWorld_Mbed by
Diff: main.cpp
- Revision:
- 6:3689cb2a18f4
- Parent:
- 5:4e99dfae8dca
--- 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); } } - - - - - -