Test pc-console

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
hayashiisme
Date:
Tue Jan 14 01:49:31 2014 +0000
Commit message:
Test pc-console

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r da079d83425e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jan 14 01:49:31 2014 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+
+int main() {
+    pc.baud(921600);
+    printf("921600 hit key 3 times\r\n");
+
+    int lc = 3;
+
+    while(lc) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+        if(pc.readable()){
+            int c = pc.getc();
+            printf("input key=%c\r\n", c);
+            lc--;
+            //break;
+        }
+    }
+    printf("end\r\n");
+}
diff -r 000000000000 -r da079d83425e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jan 14 01:49:31 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59
\ No newline at end of file