Ohnishi_Gundan / Mbed 2 deprecated Master-FM

Dependencies:   MODSERIAL mbed-rtos mbed

Fork of Master by Ohnishi_Gundan

Committer:
9uS7
Date:
Thu Sep 11 14:42:49 2014 +0000
Revision:
1:e1cfb5850088
Parent:
0:4f07ba929908
Child:
2:c610e1a7fbcd
can compile

Who changed what in which revision?

UserRevisionLine numberNew contents of line
9uS7 0:4f07ba929908 1 #include "mbed.h"
9uS7 0:4f07ba929908 2 #include "bluetooth.h"
9uS7 0:4f07ba929908 3
9uS7 1:e1cfb5850088 4 Serial bt(p13, p14); // tx, rx
9uS7 0:4f07ba929908 5
9uS7 1:e1cfb5850088 6 void btSetup(int role)
9uS7 0:4f07ba929908 7 {
9uS7 1:e1cfb5850088 8 if( role==BT_MASTER ){
9uS7 1:e1cfb5850088 9 //if this device is the master
9uS7 1:e1cfb5850088 10 bt.baud(9600);
9uS7 1:e1cfb5850088 11 bt.printf("$$$");
9uS7 1:e1cfb5850088 12 wait(0.5);
9uS7 1:e1cfb5850088 13 bt.printf("C\r");
9uS7 1:e1cfb5850088 14 wait(0.5);
9uS7 1:e1cfb5850088 15 }
9uS7 1:e1cfb5850088 16 else{
9uS7 1:e1cfb5850088 17 //if this device is the slave
9uS7 1:e1cfb5850088 18 ; //nothing to do
9uS7 1:e1cfb5850088 19 }
9uS7 0:4f07ba929908 20 }