Use Uart
Dependencies: mbed
Fork of Serial_HelloWorld_Mbed by
Diff: main.cpp
- Revision:
- 4:3974a6c7b088
- Parent:
- 3:1f30ebd64626
- Child:
- 5:4e99dfae8dca
--- a/main.cpp Fri Jul 24 00:30:17 2015 +0000 +++ b/main.cpp Tue Aug 04 23:22:53 2015 +0000 @@ -1,15 +1,24 @@ #include "mbed.h" - + #if defined(TARGET_WIZwiki_W7500) -#define USBTX PC_2 -#define USBRX PC_3 +#define USBTX PC_2 +#define USBRX PC_3 #endif -Serial pc(USBTX, USBRX); // tx, rx - -int main() { +Serial pc(USBTX,USBRX); + +int main() { + pc.baud(9600); // set baudrate + pc.printf("Hello World!\n"); // string output + while(1) { - pc.putc(pc.getc() + 1); // typing characters + pc.putc(pc.getc()); // typing characters } -} \ No newline at end of file +} + + + + + +