Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MODSERIAL mbed-rtos mbed
Fork of Master by
Diff: bluetooth.cpp
- Revision:
- 5:37733f175430
- Parent:
- 4:aaaadb45cbd9
- Child:
- 6:df6d8ba1907a
--- a/bluetooth.cpp Fri Sep 12 08:08:21 2014 +0000
+++ b/bluetooth.cpp Fri Sep 12 11:43:36 2014 +0000
@@ -1,13 +1,14 @@
#include "mbed.h"
#include "bluetooth.h"
#include "control.h"
+#include "MODSERIAL.h"
//master
-Serial bt(p13, p14); // tx, rx
+//RawSerial bt(p13, p14); // tx, rx
//slave
-//Serial bt(p28, p27);
+MODSERIAL bt(p28, p27);
-Serial pc(USBTX, USBRX); // tx, rx
+MODSERIAL pc(USBTX, USBRX); // tx, rx
DigitalOut l1(LED1);
DigitalOut l2(LED2);
@@ -138,11 +139,12 @@
for( int i=0 ; ; i++ ){
if( bt.readable() ){
pc.printf("readable\n");
+ wait(0.05);
break;
}
else if( i>5 ){
l4 = 0;
- pc.printf("enable\n");
+ pc.printf("not readable\n");
return;
}
}
