Mark Gottscho / Mbed 2 deprecated SerialEcho

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mgottscho
Date:
Sun Mar 16 01:12:36 2014 +0000
Commit message:
Added a comment.

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	Sun Mar 16 01:12:36 2014 +0000
@@ -0,0 +1,28 @@
+/* main.cpp
+ * Tested with mbed board: FRDM-KL46Z
+ * Author: Mark Gottscho
+ * mgottscho@ucla.edu
+ */
+ 
+#include "mbed.h"
+
+/**
+ * Echo incoming serial data back out again.
+ */
+int main() {
+    Serial console(PTE16, PTE17);
+    console.baud(115200);
+    
+    char c;
+    
+    while (1) {
+        if (console.readable()) { //Wait for incoming message from host (via serial bridge)
+            c = console.getc();
+            console.putc('>');
+            console.putc(' ');
+            console.putc(c);
+            console.putc('\r');
+            console.putc('\n');
+        }   
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Mar 16 01:12:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43
\ No newline at end of file