fork 1

Dependencies:   mbed

Fork of eic_blinky_interrupt by 尚人 永井

Revision:
4:2b12ce3ec6b0
Parent:
3:50d8d4dc9ad6
diff -r 50d8d4dc9ad6 -r 2b12ce3ec6b0 main.cpp
--- a/main.cpp	Tue May 20 11:28:18 2014 +0000
+++ b/main.cpp	Tue May 20 11:31:32 2014 +0000
@@ -3,17 +3,6 @@
 Serial pc(USBTX,USBRX);//tx,rx
 AnalogOut led_y(p18);
 
-void pc_rx();
-
-int main()
-{
-    pc.attach(&pc_rx,Serial::RxIrq);
-    while(1) {
-        sleep();
-        //pc.printf("wakeup\r\n");
-    }
-}
-
 void pc_rx ()
 {
     char buff=pc.getc();
@@ -26,7 +15,15 @@
         float a=(buff-'0'+1)*0.1;//buff=='0'->a=0.1  buff=='9'->a=1.0
         led_y=a;
         pc.printf("led_y=%f\r\n",a);
+    } else {
+        pc.printf("a-z,A-Z,0-9 common!",a);        
     }
+}
 
-
-}
+int main()
+{
+    pc.attach(&pc_rx,Serial::RxIrq);
+    while(1) {
+        sleep();
+    }
+}
\ No newline at end of file