Mbed working as USB-Serial interface using MODSERIAL library. This is working well as interface between CHR-6dm position sensor and its PC soft (AHRSInterface)

Dependencies:   mbed

Revision:
0:a1601df537a8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 15 08:00:21 2011 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#define BAUD 115200
+#define TX_PIN p9
+#define RX_PIN p10
+ 
+ #include "MODSERIAL.h"
+ 
+ DigitalOut led1(LED1);
+ DigitalOut led2(LED2);
+ DigitalOut led3(LED3);
+ DigitalOut led4(LED4);
+ 
+ MODSERIAL pc(USBTX, USBRX);
+ 
+ MODSERIAL uart(TX_PIN, RX_PIN);
+
+ 
+ int main() 
+ {
+     pc.baud(BAUD);
+     uart.baud(BAUD);
+     //pc.printf("Start\n\r");
+    
+   // Transparent uart<->usb - working !
+  while(1)
+  {
+    if( pc.readable()) 
+    {led1=1; led4=0; uart.putc(pc.getc());}
+    if( uart.readable()) 
+    {led4=1; led1=0; pc.putc(uart.getc());} 
+  }
+ }    
\ No newline at end of file