Demonstration code showing how to control an LED over Bluetooth Low Energy using the UARTService
Dependencies: BLE_API mbed nRF51822
Fork of BLE_LoopbackUART by
This programme demonstrates the use of the UARTService to send command strings over Bluetooth Low Energy (BLE) to control devices attached to the nRF51822 board.
In this example you can use a BLE connection from smart phone to turn on and off LED2 on the board.
Sending the character string "led2 on" will turn the LED on and "led2 off" will turn it off.
The command that is received is also echoed back via BLE to the sending device.
You can use the nRF UART App on and Android or iOS smart phone with BLE to test this out https://www.nordicsemi.com/eng/Products/nRFready-Demo-APPS
I have also ported the source code for the Android app into Android studio which should be a good starting point for developing your own custom App https://github.com/bennthomsen/nRF_UART. If you want to start using this within Android Studio create for own fork in GitHub and then from within Android Studio VCS>Checkout from Version Control>GitHub
History
Line 85: was edited to include:
2015-01-02, by djmannion [Fri, 02 Jan 2015 15:15:54 +0000] rev 15
Line 85: was edited to include:
; ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED| GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
;
; This allowed the UART app to connect to the board successfully.
Removed unnecessary code.; Turned console DEBUG off
2014-12-17, by bthomsen [Wed, 17 Dec 2014 22:47:39 +0000] rev 14
Removed unnecessary code.; Turned console DEBUG off
modified to control LED2 by sending commands over BLE; "led2 on" turns LED2 on; "led2 off" turns LED2 off;
2014-12-17, by bthomsen [Wed, 17 Dec 2014 22:43:40 +0000] rev 13
modified to control LED2 by sending commands over BLE; "led2 on" turns LED2 on; "led2 off" turns LED2 off;
Initial Commit: Added comments
2014-12-17, by bthomsen [Wed, 17 Dec 2014 19:46:22 +0000] rev 12
Initial Commit: Added comments
updating underlying libraries.
2014-12-09, by rgrover1 [Tue, 09 Dec 2014 08:55:59 +0000] rev 11
updating underlying libraries.
updating to 0.2.5 of the BLE_API
2014-11-28, by rgrover1 [Fri, 28 Nov 2014 14:18:56 +0000] rev 10
updating to 0.2.5 of the BLE_API
updating underlying libraries.
2014-11-05, by rgrover1 [Wed, 05 Nov 2014 14:17:33 +0000] rev 9
updating underlying libraries.
updating underlying libraries
2014-09-30, by rgrover1 [Tue, 30 Sep 2014 02:20:59 +0000] rev 8
updating underlying libraries
updating to the latest version of the underlying libraries.
2014-09-23, by rgrover1 [Tue, 23 Sep 2014 15:14:06 +0000] rev 7
updating to the latest version of the underlying libraries.
updating to 0.2.0 of the BLE_API
2014-09-22, by rgrover1 [Mon, 22 Sep 2014 10:42:54 +0000] rev 6
updating to 0.2.0 of the BLE_API