Bradley Kohler
/
PulseRate
MAX30100 pulse rate sensor
Diff: MAX30100.h
- Revision:
- 2:d329886938f1
- Parent:
- 1:0c2135629097
- Child:
- 3:fa37b0c705b3
--- a/MAX30100.h Fri Aug 18 02:58:06 2017 +0000 +++ b/MAX30100.h Wed Aug 23 19:04:51 2017 +0000 @@ -21,6 +21,8 @@ #define MAX30100_REV_ID 0xFE // Part revision #define MAX30100_PART_ID 0xFF // Part ID, normally 0x11 +#define POR_PART_ID 0x11 + typedef enum{ // This is the same for both LEDs pw200, // 200us pulse pw400, // 400us pulse @@ -69,6 +71,7 @@ public: + //Wire read and write protocols void writeByte(uint8_t address, uint8_t subAddress, uint8_t data) { char data_write[2]; @@ -95,10 +98,11 @@ i2c.write(address, data_write, 1, 1); // no stop i2c.read(address, data, count, 0); for(int ii = 0; ii < count; ii++) { - dest[ii] = data[ii]; + dest[ii] = data[ii]; } } - + // + void setLEDs(pulseWidth pw, ledCurrent red, ledCurrent ir){ uint8_t reg = readByte(MAX30100_ADDRESS, MAX30100_SPO2_CONFIG); reg = reg & 0xFC; // Set LED_PW to 00