ライブラリのUSBシリアル通信接続のサンプルプログラム

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 //受信したシリアルデータをそのまま送信(エコー)します
00002 #include "mbed.h" 
00003 00004 Serial pc(USBTX, USBRX); // tx, rx 
00005 00006 int main() { 
00007     pc.printf("Hello World!"); 
00008     while(1) { 
00009     pc.putc(pc.getc()+1);   //+1はascllコードに+1がされている
00010     } 
00011 } 
00012