Latest Bluetooth transmission from mbedLPC1768 & HP-05 working with android phone

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
parthchandak02
Date:
Sat Mar 31 02:42:27 2018 +0000
Commit message:
3.30.18 - Bluetooth communication with mbed

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	Sat Mar 31 02:42:27 2018 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+Serial blue(p9, p10);          // TX, RX
+
+DigitalOut pcLED(LED1);
+DigitalOut blueLED(LED4);
+
+int main()
+{
+    pc.baud(9600);
+    blue.baud(9600);
+ 
+//    blue.printf("\n\nBluetooth Communication Stared!\n\n");
+    
+    int x = 0;
+    while(1)
+    {
+        if(pc.readable())
+        {
+            pcLED = !pcLED;
+        }
+        if(blue.readable())
+        {
+            blueLED = !blueLED;
+            pc.printf("Read character %c\n",blue.getc());  
+        }
+        
+        pc.printf("Printing to serial: %d\n",x);
+        blue.printf("Printing to blue: %d\n",x);
+        
+        x+=1;
+        
+        wait(0.5);
+    }    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 31 02:42:27 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file