Library for MAX30101 SpO2 and heart rate sensor
Dependents: HeartRate HeartRate proj final_project_ee119 ... more
Diff: MAX30101.cpp
- Revision:
- 10:85513b7480f5
- Parent:
- 8:cc2dae00ce63
diff -r 28164e9ac58e -r 85513b7480f5 MAX30101.cpp --- a/MAX30101.cpp Sat Sep 02 11:51:48 2017 -0700 +++ b/MAX30101.cpp Sat Sep 02 11:57:40 2017 -0700 @@ -53,8 +53,11 @@ //***************************************************************************** int32_t MAX30101::enableInterrupts(const InterruptBitField_u data) { - char cmdData[3] = {InterruptEnable1, (data.all & 0xF0), (data.all & 0x02)}; - + char cmdData[3]; + cmdData[0] = InterruptEnable1; + cmdData[1] = (data.all & 0xF0); + cmdData[2] = (data.all & 0x02); + return m_i2cBus.write(I2C_W_ADRS, cmdData, 3); }