Supergeniene på bakerste rad / Mbed 2 deprecated LAB10_Oppgave3

Dependencies:   mbed

Fork of LAB10_Oppgave3 by EL-POM1001

Files at this revision

API Documentation at this revision

Comitter:
rlanghbv
Date:
Wed Nov 04 20:58:44 2015 +0000
Child:
1:05b1d2a203e5
Commit message:
Serial3 Loopback

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 Nov 04 20:58:44 2015 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+Serial serial3(PB_9, PB_8); // tx, rx
+Serial pc(USBTX, USBRX);    // tx, rx
+
+void serial3Rx()
+{
+  putchar(serial3.getc());   
+}
+
+void pcRx()
+{
+   serial3.putc(pc.getc());
+}
+
+int main() 
+{   
+    serial3.attach(&serial3Rx);
+    pc.attach(&pcRx);
+    
+    
+    while(1) 
+    {
+       wait(1);
+    }    
+}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 04 20:58:44 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7
\ No newline at end of file