Ejemplo de BLE_UART desarrollado
Dependencies: BLE_API mbed nRF51822
Fork of BLE_UARTConsole by
Diff: main.cpp
- Revision:
- 10:0a896ba3c886
- Parent:
- 9:5f0732aa3008
diff -r 5f0732aa3008 -r 0a896ba3c886 main.cpp --- a/main.cpp Tue Sep 29 12:12:10 2015 +0000 +++ b/main.cpp Thu Jun 30 05:03:17 2016 +0000 @@ -29,8 +29,11 @@ #define DEBUG(...) /* nothing */ #endif /* #if NEED_CONSOLE_OUTPUT */ +#define TX_RX_MSG_LENGTH 160 + BLEDevice ble; DigitalOut led1(LED1); +DigitalOut led2(LED2); UARTService *uart; void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *params) @@ -42,8 +45,13 @@ void periodicCallback(void) { + uint8_t a; led1 = !led1; DEBUG("ping\r\n"); + a= uart->_getc(); + if (a=='G') { + led2= !led2; + } } int main(void)