obniz Parts Library

Grove_EarHeartRate

GitHub
Grove_EarHeartRate
Usable Devices :
obniz_board
m5stickc
Found at :
秋月電子通商
www.seeedstudio.com

Grove_EarHeartRate

Grove - Ear-clip Heart Rate Sensor

Stores

http://wiki.seeedstudio.com/Grove-Ear-clip_Heart_Rate_Sensor/

https://www.switch-science.com/catalog/2526/

wired(obniz, {gnd, vcc, signal, grove})

Connect Grove cables.
Black: GND, Red: VCC, Yellow: Signal.

// Javascript Example
var heartrate = obniz.wired("Grove_EarHeartRate", {gnd: 0, vcc: 1, signal: 2});
heartrate.start(function(rate){
  console.log(rate);
})

If the device has a grove interface, it can be connected with just the parameter {grove: obniz.grove0}.

// Javascript Example
var heartrate = obniz.wired("Grove_EarHeartRate", {grove: obniz.grove0});

start(callback(heartrate))

measure heart rate.
It callback measured heart rate around every 3sec.(It depends network)
Callback function will be called only when data exist.

// Javascript Example
var heartrate = obniz.wired("Grove_EarHeartRate", {gnd: 0, vcc: 1, signal: 2});
heartrate.start(function(rate){
  console.log(rate);
})

[await] getWait()

measure heart rate once.

// Javascript Example
var heartrate = obniz.wired("Grove_EarHeartRate", {gnd: 0, vcc: 1, signal: 2});
var rate = await heartrate.getWait();
console.log(rate);

Supported from: obniz.js 3.5.0