Ohnishi_Gundan / Mbed 2 deprecated Master-FM

Dependencies:   MODSERIAL mbed-rtos mbed

Fork of Master by Ohnishi_Gundan

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;
         }    
     }