Simon Ford / Mbed 2 deprecated Serial2Serial

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
simon
Date:
Sun Feb 13 20:43:09 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
diff -r 000000000000 -r 3c9dd1f868aa main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Feb 13 20:43:09 2011 +0000
@@ -0,0 +1,19 @@
+// example showing sending/receiving character
+
+#include "mbed.h"
+
+// connect p9 to p14 with a wire!
+Serial out(p9, NC);
+Serial in(NC, p14);
+
+DigitalOut led(LED1);
+
+int main() {
+    out.putc('h');
+    out.putc('i');
+    char c1 = in.getc();
+    char c2 = in.getc();
+    
+    led = 1;
+    printf("c1: %c, c2: %c\n", c1, c2); 
+}
diff -r 000000000000 -r 3c9dd1f868aa mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Feb 13 20:43:09 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912