LPC1114受信割り込みテスト

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
suu____
Date:
Mon May 04 09:47:19 2015 +0000
Parent:
0:5556c497ecca
Commit message:
??????

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5556c497ecca -r 69b097d9ec91 main.cpp
--- a/main.cpp	Mon May 04 09:23:17 2015 +0000
+++ b/main.cpp	Mon May 04 09:47:19 2015 +0000
@@ -3,16 +3,20 @@
 Serial pc(dp16,dp15);
 DigitalOut led1(LED1);
 
+
+//受信バッファに送られた文字を送り返す
 void loopback(){
     pc.putc(pc.getc());
     }
 
 int main() {
-    pc.baud(115200);
+    pc.baud(9600);
+    //割り込み関数を登録
     pc.attach(loopback,Serial::RxIrq);
     
     while(1) {
-        led1 = 1;
+    //LEDを点滅
+    led1 = 0;
     wait(1);
     led1 = 0;
     wait(1);