Use Uart

Dependencies:   mbed

Fork of Serial_HelloWorld_Mbed by eunkyoung kim

main.cpp

Committer:
IOP
Date:
2015-07-24
Revision:
3:1f30ebd64626
Parent:
2:ab03b0b5012c
Child:
4:3974a6c7b088

File content as of revision 3:1f30ebd64626:

#include "mbed.h"
 
#if defined(TARGET_WIZwiki_W7500)
#define USBTX                  PC_2
#define USBRX                  PC_3
#endif

Serial pc(USBTX, USBRX); // tx, rx
 
int main() {
    pc.printf("Hello World!\n");    // string output
    while(1) {
        pc.putc(pc.getc() + 1);     // typing characters
    }
}