![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A cute tiny piece of code implementing an IoT NAND device, demonstrating how to setup and advertise a cute GATT (NAND) service. The code has been tested on a Nordic nRF51822-DK.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_HeartRate_IDB0XA1 by
Diff: main.cpp
- Revision:
- 3:a51ca6313ad2
- Parent:
- 2:bc0c0d442a24
- Child:
- 13:227a0149b677
--- a/main.cpp Tue Sep 29 09:23:04 2015 +0000 +++ b/main.cpp Tue Sep 29 15:06:46 2015 +0000 @@ -21,10 +21,7 @@ #include "ble/services/DeviceInformationService.h" BLE ble; - -#if !defined(IDB0XA1_D13_PATCH) DigitalOut led1(LED1); -#endif const static char DEVICE_NAME[] = "HRM1"; static const uint16_t uuid16_list[] = {GattService::UUID_HEART_RATE_SERVICE, @@ -38,10 +35,7 @@ void periodicCallback(void) { - -#if !defined(IDB0XA1_D13_PATCH) led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */ -#endif /* Note that the periodicCallback() executes in interrupt context, so it is safer to do * heavy-weight sensor polling from the main thread. */ triggerSensorPolling = true; @@ -49,10 +43,7 @@ int main(void) { - -#if !defined(IDB0XA1_D13_PATCH) led1 = 1; -#endif Ticker ticker; ticker.attach(periodicCallback, 1); // blink LED every second