* ECHO communication between Bluetooth and RS232 * Using mBED Landtiger Card
Fork of HC05_Transparent_mode by
main.cpp
- Committer:
- edodm85
- Date:
- 2013-10-18
- Revision:
- 1:8c500bcdcbc4
- Parent:
- 0:44f245e8b430
- Child:
- 2:f76f36540871
File content as of revision 1:8c500bcdcbc4:
/* * Author: Edoardo De Marchi * Date: 02-07-13 * Notes: HC05 Trasparent Mode */ #include "mbed.h" #define SERIAL_2 Serial pc(USBTX, USBRX); #ifdef SERIAL_1 Serial blue(p9,p10); // HC05 #endif #ifdef SERIAL_2 Serial blue(p13,p14); // TX = P14 RX = P13 #endif DigitalOut myled(LED1); DigitalOut myled4(LED4); int main() { blue.baud(9600); pc.baud(9600); pc.printf("Bluetooth Start\r\n"); // echo back characters and toggle the LED while (1) { if (blue.readable()) { pc.putc(blue.getc()); myled = !myled; } if (pc.readable()) { blue.putc(pc.getc()); myled4 = !myled4; } } }