Junichi Katsu / Mbed 2 deprecated SerialTest_jk

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jksoft
Date:
Sat May 21 07:30:27 2011 +0000
Commit message:

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 21 07:30:27 2011 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+Serial pc(USBTX, USBRX);
+
+int main() {
+    char	ch;
+    
+    while(1) {
+        
+        pc.printf("Push 1-4 Key->");
+        ch = pc.getc();
+        pc.printf("%c¥r¥n",ch);
+        
+        switch(ch)
+        {
+        case '1':
+            led1 =! led1;
+            break;
+        case '2':
+            led2 =! led2;
+            break;
+        case '3':
+            led3 =! led3;
+            break;
+        case '4':
+            led4 =! led4;
+            break;
+        default:
+            pc.printf("Please push the key to 1-4.¥r¥n");
+            break; 
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 21 07:30:27 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912