Library for the Grove Earbud Heartrate Sensor

Dependents:   BLE_Police_HRM_Earbud df-2014-salesforce-hrm-k64f BLE_HeartRate_ppm emoSound ... more

Revision:
4:618117fe4b04
Parent:
0:35588fbd6d5c
Child:
6:40b1e50a1d15
Child:
9:2256cd8dca35
diff -r 6d5410cdd47d -r 618117fe4b04 GroveEarbudSensor.cpp
--- a/GroveEarbudSensor.cpp	Thu Sep 25 22:14:30 2014 +0000
+++ b/GroveEarbudSensor.cpp	Fri Sep 26 02:32:53 2014 +0000
@@ -30,7 +30,7 @@
  void __grove_earbud_sensor_interrupt() { if (_grove_earbud_sensor_instance != NULL) _grove_earbud_sensor_instance->interrupt(); }
  
  // constructor
- GroveEarbudSensor::GroveEarbudSensor(InterruptIn *rx,Serial *pc) {
+ GroveEarbudSensor::GroveEarbudSensor(InterruptIn *rx,RawSerial *pc) {
      _grove_earbud_sensor_instance  = this;
      this->m_rx                     = rx;
      this->m_pc                     = pc;
@@ -83,7 +83,7 @@
       this->m_heartrate = tmp/(this->m_temp[NUM_SLOTS-1]-this->m_temp[0]);
       
       // DEBUG/Log
-      LOG_CONSOLE("heartrate: %d bpm\r\n",this->m_heartrate);
+      if (this->m_heartrate > 0) LOG_CONSOLE("heartrate: %d bpm\r\n",this->m_heartrate);
       
       // invoke any callbacks we might have
       if (this->m_cb_fn != NULL) {