serial pc board pass through, use your board like a usb-serial 3.3V level converter,

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
felipeM
Date:
Sat Oct 05 19:46:21 2013 +0000
Commit message:
FRDM seral pc board pass through based in :; https://mbed.org/handbook/SerialPC

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 bab6dd4a9c11 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 05 19:46:21 2013 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+ 
+Serial pc(USBTX, USBRX);
+//TX RX pins, see https://mbed.org/handbook/mbed-FRDM-KL25Z
+Serial uart(PTC4, PTC3);
+//to test is you can use a hard bridge (piece of cable) between PTC4 and PTC3 open a terminal and write something :) 
+//you can integrate this to improve some interesting aplicattions like this:
+//http://www.instructables.com/id/Temperature-sensor--weatherstation/http://www.instructables.com/id/Temperature-sensor--weatherstation/ 
+DigitalOut pc_activity(LED1);
+DigitalOut uart_activity(LED2);
+ 
+int main() {
+    while(1) {
+        if(pc.readable()) {
+            uart.putc(pc.getc());
+            pc_activity = !pc_activity;
+        }
+        if(uart.readable()) {
+            pc.putc(uart.getc());
+            uart_activity = !uart_activity;
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r bab6dd4a9c11 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Oct 05 19:46:21 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file