bamlormakmak

Dependencies:   mbed

Revision:
0:0216e64ccf1b
Child:
1:1197e9258bc7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 08 14:03:08 2017 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+Serial pc(USBTX, USBRX);
+Serial bt(PA_15, PB_7);
+int main(void)
+{
+    char ch;
+    pc.baud(38400);
+    bt.baud(38400);
+    pc.printf("Hello World!\n\r");
+    bt.printf("Hello World!\r\n");
+    
+    while(1)
+    {
+        if(bt.readable())
+        {
+            ch=bt.getc();
+            pc.printf("%c",ch);
+        }
+        
+        else if(pc.readable())
+        {
+            ch=pc.getc();
+            bt.printf("%c",ch);
+        }
+    }
+}
\ No newline at end of file