heart rate monitor

Dependencies:   BLE_API GroveEarbudSensor mbed nRF51822

Fork of BLE_HeartRate by Bluetooth Low Energy

Revision:
47:430545f41113
Parent:
46:ee7c55907f36
Child:
50:477004d54431
diff -r ee7c55907f36 -r 430545f41113 main.cpp
--- 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);