# Oximeter error message

**URL:** <https://community.sparkfun.com/t/oximeter-error-message/39527>\
**Category:** Biometrics\
**Created:** [May 4, 2020, 10:26pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527 "2020-05-04T22:26:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leithauser](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@Leithauser](https://community.sparkfun.com/u/Leithauser)\
**Post date:** [May 4, 2020, 10:26pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/1 "2020-05-04T22:26:29Z")

</div>

When I run the 30105 code I downloaded from Github for the oximeter, I get the message “Example8\_SPO2:144:125: error: cannot convert ‘uint16\_t\* {aka unsigned int\*}’ to ‘uint32\_t\* {aka long unsigned int\*}’ for argument ‘1’ to ‘void maxim\_heart\_rate\_and\_oxygen\_saturation(uint32\_t\*, int32\_t, uint32\_t\*, int32\_t\*, int8\_t\*, int32\_t\*, int8\_t\*)’”. It appears the variable uint16\_t is defined as an unsigned integer in one place and a long unsigned integer in another. How can I fix this, or is there a better library for this device?

---

<div class="post-metadata">

**Author:** ![TS-Chris](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-chris/32/6057_2.png) [@TS-Chris](https://community.sparkfun.com/u/TS-Chris)\
**Post date:** [May 6, 2020, 9:20pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/2 "2020-05-06T21:20:56Z")

</div>

What board type are you compiling for? I’m not able to reproduce your error.

---

<div class="post-metadata">

**Author:** ![Leithauser](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@Leithauser](https://community.sparkfun.com/u/Leithauser)\
**Post date:** [May 8, 2020, 1:43am UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/3 "2020-05-08T01:43:57Z")

</div>

I was compiling to an Arduino Mega, since I got a warning that memory was low on an Uno

---

<div class="post-metadata">

**Author:** ![Leithauser](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@Leithauser](https://community.sparkfun.com/u/Leithauser)\
**Post date:** [May 8, 2020, 1:46am UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/4 "2020-05-08T01:46:52Z")

</div>

It seems like the board should not matter since the error message indicates that the variable was defined as an unsigned integer and the function was expecting an unsigned long integer. I could not find where the function was defined to change it to expect an unsigned integer or where the variable was defined to change it to an unsigned long.

---

<div class="post-metadata">

**Author:** ![TS-Chris](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-chris/32/6057_2.png) [@TS-Chris](https://community.sparkfun.com/u/TS-Chris)\
**Post date:** [May 8, 2020, 3:46pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/5 "2020-05-08T15:46:34Z")

</div>

I’m still not able to replicate the error you’re seeing when I compile that sketch on a Mega.

You might try deleting the library and [[reinstalling it from Github](https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library) to see if that helps.]([GitHub - sparkfun/SparkFun\_MAX3010x\_Sensor\_Library: An Arduino Library for the MAX3015 particle sensor and MAX30102 Pulse Ox sensor](https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library))

---

<div class="post-metadata">

**Author:** ![Leithauser](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@Leithauser](https://community.sparkfun.com/u/Leithauser)\
**Post date:** [May 9, 2020, 10:12pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/6 "2020-05-09T22:12:28Z")

</div>

Thank you for your help. I downloaded the library you linked to and the problem disappeared. I think the library I downloaded before was different, although the code and comments appear identical. Perhaps that library had a bad file.

The program now works, sort of. It is giving me readings, but highly inaccurate ones. It seems to almost constantly read my HR as 150 ppm, although I know the correct value is about 60 ppm. It reads my SPO2 as 99 to 100, although the correct value is about 96. (I am simultaneously taking measurements with a commercial oximeter.) Any thoughts on how to get more accurate data?

---

<div class="post-metadata">

**Author:** ![TS-Chris](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-chris/32/6057_2.png) [@TS-Chris](https://community.sparkfun.com/u/TS-Chris)\
**Post date:** [May 11, 2020, 4:53pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/7 "2020-05-11T16:53:58Z")

</div>

You may need to play around with placement on the finger and how much pressure the finger is applying to the sensor to get the best results. I’ve noticed that these can be a bit picky with those two variables.

---

<div class="post-metadata">

**Author:** ![maxalw](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@maxalw](https://community.sparkfun.com/u/maxalw)\
**Post date:** [July 27, 2020, 2:26pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/8 "2020-07-27T14:26:17Z")

</div>

> TS-Chris:  
> I’m still not able to replicate the error you’re seeing when I compile that sketch on a Mega.
> 
> You might try deleting the library and [[reinstalling it from Github](https://www.google.com/) to see if that helps.  
> [/quote]
> 
> Thanks, it helps]([https://www.google.com/](https://www.google.com/))

---

<div class="post-metadata">

**Author:** ![Arpan](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Arpan](https://community.sparkfun.com/u/Arpan)\
**Post date:** [August 4, 2024, 5:40pm UTC](https://community.sparkfun.com/t/oximeter-error-message/39527/9 "2024-08-04T17:40:47Z")

</div>

Hi Chris

I have recently work on a project with MAX30102 sensor. I used ESP32 with MAX30102 sensor to get the SPO2 value. But when I verify the code in Arduino IDE it was shown error I2C… not declared on the scope. For few modifications like the changes of ESP32 pin number 21 and 22 instead of Arduino 13 and 11 and in I2C section. It was uploaded but the values are not much accurate. It hang around (100-98) only, and Heart Rate much Higher (150-166).

Now I going to change some modifications in the light intensity and frequency. At this time it was showing error on that same I2C line (line number 64)in the void setup.

I was again going to set all the values as default as previous when the code is working but the problem was still same. So will the problem is in the code or in the MAX30102 sensor? Or the problem arise from Arduino IDE?

Please help
