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.
Dependents: BLE_Police_HRM_Earbud df-2014-salesforce-hrm-k64f BLE_HeartRate_ppm emoSound ... more
Diff: GroveEarbudSensor.h
- Revision:
- 8:06be613d8c3e
- Parent:
- 5:56720730382d
- Child:
- 11:30d8d0a456f3
diff -r 56720730382d -r 06be613d8c3e GroveEarbudSensor.h
--- a/GroveEarbudSensor.h Fri Sep 26 02:38:54 2014 +0000
+++ b/GroveEarbudSensor.h Wed Oct 01 21:34:06 2014 +0000
@@ -51,10 +51,6 @@
#include "mbed.h"
-// Console
-#include "BufferedSerial.h"
-BufferedSerial pc(USBTX,USBRX);
-
// Blinky
DigitalOut led(LED1);
@@ -66,31 +62,31 @@
// callback for receiving heartrate values
void heartrateCallback(float heartrate,void *data) {
- pc.printf("Callback: heartrate = %.1f\r\n",heartrate);
+ printf("Callback: heartrate = %.1f\r\n",heartrate);
}
int main()
{
// announce
- pc.printf("Grove Earbud Sensor Example v1.0.0\r\n");
+ printf("Grove Earbud Sensor Example v1.0.0\r\n");
// allocate the earbud sensor
- pc.printf("Allocating earbud sensor instance...\r\n");
+ printf("Allocating earbud sensor instance...\r\n");
GroveEarbudSensor earbud(&sensor);
// register our callback function
- pc.printf("registering callback...\r\n");
+ printf("registering callback...\r\n");
earbud.registerCallback(heartrateCallback);
// begin main loop
- pc.printf("Beginning main loop...\r\n");
+ printf("Beginning main loop...\r\n");
while (true) {
// blink...
led = !led;
wait(0.5);
// we can also call directly
- //pc.printf("Direct: heartrate = %.1f\r\n",earbud.getHeartRate());
+ //printf("Direct: heartrate = %.1f\r\n",earbud.getHeartRate());
}
}

Grove Ear-clip Heart Rate Sensor