Oxford cwm serial 01

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
codabash
Date:
Wed May 01 15:04:45 2013 +0000
Commit message:
Serial comms oxford - trial 01

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	Wed May 01 15:04:45 2013 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+DigitalOut l1(LED1);
+DigitalOut l2(LED2);
+DigitalOut l3(LED3);
+
+Serial talky(PTC4, PTC3);
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+l1=1;
+l2=1;
+l3=1;
+    while(1) {
+    if (pc.readable() && talky.writeable()){
+    char c = pc.getc();
+    l1=!l1;
+    talky.putc(c);
+    wait(0.01);
+    l1=!l1;
+    }
+    if (talky.readable() && pc.writeable()){
+    l2=!l2;
+    char c2 = talky.getc();
+    wait(0.01);
+    l2=!l2;
+    pc.putc(c2);
+        }  
+    wait(0.01);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed May 01 15:04:45 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd
\ No newline at end of file