Library for the Grove Earbud Heartrate Sensor
Dependents: BLE_Police_HRM_Earbud df-2014-salesforce-hrm-k64f BLE_HeartRate_ppm emoSound ... more
Revision 8:06be613d8c3e, committed 2014-10-01
- Comitter:
- sam_grove
- Date:
- Wed Oct 01 21:34:06 2014 +0000
- Parent:
- 5:56720730382d
- Child:
- 9:2256cd8dca35
- Commit message:
- Remove BufferedSerial from example
Changed in this revision
GroveEarbudSensor.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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()); } }