Adafruit Bluefruit with KL25Z
Dependencies: BLE_nRF8001 mbed
Simple implementation of UART on FRDM KL25Z board with nRF8001 Adafruit breakout. Uses RedBearLabs Library and could be made to work with their BLE Shield.
UART Characteristics can be changed to work with either RedBearLabs BLE Controller app or using the Nordic settings the nRF apps or the Adafruit Bluefruit LE apps.
Diff: main.cpp
- Revision:
- 5:83be623f6ad4
- Parent:
- 4:fb6008860882
- Child:
- 6:7b16a72aebe8
--- a/main.cpp Fri Mar 10 13:20:55 2017 +0000 +++ b/main.cpp Fri Mar 10 18:11:45 2017 +0000 @@ -45,7 +45,7 @@ //*----- BLE Utility -------------------------------------------------------------------------*/ // create peripheral instance, see pinouts above -BLEPeripheral blePeripheral = BLEPeripheral(&BLE_REQ, &BLE_RDY, NULL); +BLEPeripheral blePeripheral = BLEPeripheral(&BLE_REQ, &BLE_RDY, &BLE_RESET); // create service BLEService uartService = BLEService("713d0000503e4c75ba943148f18d941e"); @@ -54,6 +54,18 @@ BLECharacteristic txCharacteristic = BLECharacteristic("713d0002503e4c75ba943148f18d941e", BLENotify, 20); BLECharacteristic rxCharacteristic = BLECharacteristic("713d0003503e4c75ba943148f18d941e", BLEWriteWithoutResponse, 20); /*--------------------------------------------------------------------------------------------*/ +// +// Nordic characteristics work with Nordic and Bluefruit LE app +// uartService 6E400001-B5A3-F393-E0A9-E50E24DCCA9E +// txCharacteristic 6E400002-B5A3-F393-E0A9-E50E24DCCA9E +// rxCharacteristic 6E400003-B5A3-F393-E0A9-E50E24DCCA9E +// RedBearLabs characteristics work with RedBear BLE Controller app +// https://itunes.apple.com/us/app/ble-controller/id855062200?mt=8 +// uartService 713d0000503e4c75ba943148f18d941e +// txCharacteristic 713d0002503e4c75ba943148f18d941e +// rxCharacteristic 713d0003503e4c75ba943148f18d941e + + unsigned int interval = 0; unsigned char count_on = 0;