Use Uart

Dependencies:   mbed

Fork of Serial_HelloWorld_Mbed by eunkyoung kim

Committer:
IOP
Date:
Tue Aug 04 23:22:53 2015 +0000
Revision:
4:3974a6c7b088
Parent:
3:1f30ebd64626
Child:
5:4e99dfae8dca
add baudrate function

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:879aa9d0247b 1 #include "mbed.h"
IOP 4:3974a6c7b088 2
eunkyoungkim 2:ab03b0b5012c 3 #if defined(TARGET_WIZwiki_W7500)
IOP 4:3974a6c7b088 4 #define USBTX PC_2
IOP 4:3974a6c7b088 5 #define USBRX PC_3
eunkyoungkim 2:ab03b0b5012c 6 #endif
eunkyoungkim 2:ab03b0b5012c 7
IOP 4:3974a6c7b088 8 Serial pc(USBTX,USBRX);
IOP 4:3974a6c7b088 9
IOP 4:3974a6c7b088 10 int main() {
IOP 4:3974a6c7b088 11 pc.baud(9600); // set baudrate
IOP 4:3974a6c7b088 12
IOP 3:1f30ebd64626 13 pc.printf("Hello World!\n"); // string output
IOP 4:3974a6c7b088 14
mbed_official 0:879aa9d0247b 15 while(1) {
IOP 4:3974a6c7b088 16 pc.putc(pc.getc()); // typing characters
mbed_official 0:879aa9d0247b 17 }
IOP 4:3974a6c7b088 18 }
IOP 4:3974a6c7b088 19
IOP 4:3974a6c7b088 20
IOP 4:3974a6c7b088 21
IOP 4:3974a6c7b088 22
IOP 4:3974a6c7b088 23
IOP 4:3974a6c7b088 24