Luke Pell / Mbed 2 deprecated HC05

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lmpell
Date:
Mon Mar 19 15:59:44 2018 +0000
Commit message:
File version for HC-05 AT-Command

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	Mon Mar 19 15:59:44 2018 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX );
+
+Serial blue(PTC15, PTC14); //tx, rx
+
+
+
+int main()
+{
+    int i = 0;
+    pc.baud(9600);                      //setting pc baud rate to 9600
+    pc.printf("Enter AT Command\n");    //displaying to terminal
+    blue.baud(38400);                   //setting bluetooth baud rate to 38400
+    
+    while (true) {
+            
+        //while pc is sending data
+        while(pc.readable())             
+        {
+            //send data to bluetooth device
+            blue.putc(pc.getc());
+        }
+        //while bluetooth device is sending data
+        while(blue.readable())
+        {
+            //send data to pc
+            pc.putc(blue.getc());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 19 15:59:44 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02
\ No newline at end of file