Robotics / Mbed 2 deprecated Roboticslab2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
n6martin
Date:
Thu Mar 06 20:52:46 2014 +0000
Commit message:
bluetooth

Changed in this revision

bluetooth.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/bluetooth.cpp	Thu Mar 06 20:52:46 2014 +0000
@@ -0,0 +1,24 @@
+#include <mbed.h>
+
+Serial pc(USBTX, USBRX); // tx, rx
+Serial BluetoothSerial(p13, p14);  // tx, rx
+
+char x;
+
+int main() {
+BluetoothSerial.baud(9600);
+do {
+    if (pc.readable()) {
+        x=pc.getc();
+        // Receive keyboard entry and send to Bluetooth channel
+        BluetoothSerial.putc(x); 
+        pc.putc(x); //Echo keyboard entry
+        }
+        if (BluetoothSerial.readable()) {
+            x=BluetoothSerial.getc();
+            pc.putc(x);
+            BluetoothSerial.putc(x);
+            }
+    }
+    while (x!='q');
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 06 20:52:46 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/869cf507173a
\ No newline at end of file