Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822 X_NUCLEO_IDB0XA1
Fork of BLE_HeartRate by
Diff: main.cpp
- Revision:
- 47:430545f41113
- Parent:
- 46:ee7c55907f36
- Child:
- 50:477004d54431
--- a/main.cpp Tue Sep 30 00:07:32 2014 +0000
+++ b/main.cpp Tue Sep 30 02:14:27 2014 +0000
@@ -21,6 +21,7 @@
#include "DeviceInformationService.h"
BLEDevice ble;
+DigitalOut led1(LED1);
const static char DEVICE_NAME[] = "Nordic_HRM";
static const uint16_t uuid16_list[] = {GattService::UUID_HEART_RATE_SERVICE,
@@ -35,6 +36,8 @@
void periodicCallback(void)
{
+ led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */
+
/* Note that the periodicCallback() executes in interrupt context, so it is safer to do
* heavy-weight sensor polling from the main thread. */
triggerSensorPolling = true;
@@ -42,6 +45,7 @@
int main(void)
{
+ led1 = 1;
Ticker ticker;
ticker.attach(periodicCallback, 1);
