UART connection demo.

Dependencies:   mbed

Revision:
0:c00df3e62680
diff -r 000000000000 -r c00df3e62680 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 25 15:46:25 2012 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+Serial device(p9, p10);  // tx, rx
+
+int main() {
+    device.baud(19200);
+    device.printf("?");
+    
+    int i;
+    for (i = 0; i < 20; i++) {
+        device.printf("<NUMK VAL=%d>kaime no zikko'u de_su\r", i + 1);        
+        for (;;) {
+            if(device.readable()) {
+                if (device.getc() == '>') {
+                    break;
+                }
+            }
+            wait(0.5);
+        }
+    }
+    device.printf("owari de_su\r");
+}