Code to publish hello world through bluetooth

Dependencies:   mbed

Fork of Bluetooth_HC-06 by Ohad BarSimanTov

main.cpp

Committer:
darcy11025
Date:
2016-12-12
Revision:
1:4e7a04a1553c
Parent:
0:feba469f2cf1

File content as of revision 1:4e7a04a1553c:

// Bluetooth HC-06 may work for HC-05 (I didn't try - check https://mbed.org/users/edodm85/notebook/HC-05-bluetooth/) 
// Use pins (p13, TXD - PTC3) on FRDM-KL25Z
// Use both USBs to power the HC-06 (J9_12 - GND, J9_10 - 5V usb(VCC))
#include "mbed.h"
 
Serial HC06(p13,p14);
 
int main() {
    HC06.baud(9600);
    HC06.printf("Press 'r'\n");
    while (1) {
        char c = HC06.getc();
        if(c == 'r') {
            HC06.printf("Hello World\n");
        }
    }
}