Test using the base BLE_HeartRate example to see the effect of increasing the "ticker" rate on stability (intending to do AnalogIn around 1ms rate)
Dependencies: BLE_API mbed nRF51822
Diff: main.cpp
- Revision:
- 7:ec41c916136a
- Parent:
- 6:17bbfe13b5e4
- Child:
- 8:7407b18dfc5d
--- a/main.cpp Tue Sep 30 21:03:02 2014 +0000
+++ b/main.cpp Wed Oct 01 07:09:28 2014 +0000
@@ -35,7 +35,7 @@
#endif /* #if NEED_CONSOLE_OUTPUT */
// Sample interval (uS)
-volatile uint32_t sampleIntervalUs = 5000;
+volatile uint32_t sampleIntervalUs = 2000;
// Timer to do the sampling etc
Timer intervalTimer;
@@ -58,7 +58,7 @@
void periodicCallback(void)
{
callbackCount++;
- if (callbackCount == 200)
+ if (callbackCount == 500)
{
callbackCount = 0;
led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */
@@ -113,7 +113,7 @@
}
indicatorLed2 = !indicatorLed2;
- //hrService.updateHeartRate(hrmCounter);
+ hrService.updateHeartRate(hrmCounter);
} else {
ble.waitForEvent();
}