Hexiwear Heart rate sensor driver
Dependents: Hexi_MAX30101 Hexiwear HexiwearFinal HexiwearFinal1
Fork of FXOS8700 by
Diff: MAX30101.cpp
- Revision:
- 4:3be008e67345
- Parent:
- 3:4bfb42d6c70c
diff -r 4bfb42d6c70c -r 3be008e67345 MAX30101.cpp --- a/MAX30101.cpp Tue Aug 30 22:13:28 2016 +0000 +++ b/MAX30101.cpp Sun Sep 04 22:37:38 2016 +0000 @@ -2,10 +2,11 @@ #include "mbed.h" -MAX30101::MAX30101(PinName sda, PinName scl ,int addr) : m_i2c(sda, scl), m_addr(addr) { +MAX30101::MAX30101(PinName sda, PinName scl) : m_i2c(sda, scl){ // mode (HR, SpO2, or multi-led) mode = modeMultiLED; + m_addr = MAX30101_I2C_ADDRESS; // LED currents LEDCurrentRed = 0; LEDCurrentIR = 0; @@ -29,13 +30,13 @@ // // writeRegister( MAX30101_FIFOConfiguration , 0x06 ); // writeRegister( MAX30101_SPO2Configuration , 0x43 ); -// -// writeRegister(MAX30101_ProximityInterruptThreshold , 0x14 ); -// -// /** clear FIFO pointers */ -// writeRegister(MAX30101_FIFO_WR_PTR , 0 ); -// writeRegister(MAX30101_FIFO_RD_PTR , 0 ); -// writeRegister(MAX30101_FIFO_OV_PTR , 0 ); + + writeRegister(MAX30101_ProximityInterruptThreshold , 0x14 ); + + /** clear FIFO pointers */ + writeRegister(MAX30101_FIFO_WR_PTR , 0 ); + writeRegister(MAX30101_FIFO_RD_PTR , 0 ); + writeRegister(MAX30101_FIFO_OV_PTR , 0 ); }