How to turn a WaveShare nRF51-BLE400 into a discoverable beacon using mbed
Dependencies: mbed BLE_API nRF51822
Port for WaveShare BLE400 (chip nRF51 Aliexpress devboard)
Android Evothings good example for Nordic nRF51822-DK
As target for mbed-online used <Nordic nRF51822>
- (Large green board Nordic nRF51822-mKIT, actually deprecated on 01/03/2019)
Briefly: Handle via Evothings BLE Application 4 LEDs and 2 Buttons(via notify messages).
Figure 1: Evothings Android application screenshot
Android Evothings application sources
Happy coding!
maxxir 02/03/19
Diff: main.cpp
- Revision:
- 17:9071edee0b13
- Parent:
- 16:a84185b72bae
- Child:
- 18:0cbeb28ce4f6
--- a/main.cpp Fri Mar 01 19:41:55 2019 +0000 +++ b/main.cpp Fri Mar 01 19:51:06 2019 +0000 @@ -63,12 +63,12 @@ //------------------------------------------------------------------------- // name of the device -const static char DEVICE_NAME[] = "nRF51-BLE400"; +const static char DEVICE_NAME[] = "nRF51-BLE400"; //Edit here your name device, and also fix on Evothings APP <index.html> look ~ #136-#137 NRF51_ble.connect('nRF51-BLE400', // BLE name // GATT service and characteristic UUIDs -const UUID nRF51_GATT_SERVICE = UUID((uint8_t *)"nRF51-DK "); -const UUID nRF51_GATT_CHAR_BUTTON = UUID((uint8_t *)"nRF51-DK button "); -const UUID nRF51_GATT_CHAR_LED = UUID((uint8_t *)"nRF51-DK led "); +const UUID nRF51_GATT_SERVICE = UUID((uint8_t *)"nRF51-DK "); //Decided not edit it too +const UUID nRF51_GATT_CHAR_BUTTON = UUID((uint8_t *)"nRF51-DK button "); //Better not edit this, or need fix on Evothings APP <nordic-nRF51-ble.js> look ~ #108 device.setNotification.. +const UUID nRF51_GATT_CHAR_LED = UUID((uint8_t *)"nRF51-DK led "); //Better not edit this, or need fix on Evothings APP <nordic-nRF51-ble.js> look ~ #93 device.writeDataArray.. #define CHARACTERISTIC_BUTTON 0 #define CHARACTERISTIC_LED 1