devxplained / MAX3010x-Sensor-Library

An Arduino library for the MAX3010x sensor family.
MIT License
12 stars 6 forks source link

Compilation problems #1

Closed Surbyte closed 2 years ago

Surbyte commented 2 years ago

I try to compile each examples on ESP8266 but i receive this error. ESP32 similar problem. Works fine with Arduino UNO/NANO/MEGA. I am using IDE 1.8.14 or PlatformIO.

surby\Documents\Arduino\libraries\MAX3010x_Sensor_Library\src/MAX30101.h:8,
                 from C:\Users\surby\Documents\Arduino\libraries\MAX3010x_Sensor_Library\src/MAX3010x.h:23,
                 from C:\Users\surby\Documents\Arduino\libraries\MAX3010x_Sensor_Library\examples\MAX30105PulseoximeterMultiLED\MAX30105PulseoximeterMultiLED.ino:1:
C:\Users\surby\Documents\Arduino\libraries\MAX3010x_Sensor_Library\src/MAX3010x_multiLed_core.h: In member function 'bool MAX3010xMultiLed<MAX3010xImpl, MAX3010xSample>::setMultiLedConfigurationInternal(uint8_t, uint8_t*)':
C:\Users\surby\Documents\Arduino\libraries\MAX3010x_Sensor_Library\src/MAX3010x_multiLed_core.h:85:12: error: there are no arguments to 'clearFIFO' that depend on a template parameter, so a declaration of 'clearFIFO' must be available [-fpermissive]
   85 |     return clearFIFO();

Any suggestion will be appreciatte!

devxplained commented 2 years ago

It seems to be an issue specific to the compiler version/options used for these platforms. I can reproduce this for the Arduino Due as well. I'll look into it and update the library.

devxplained commented 2 years ago

I submitted some fixes that solve the problem for me. Can you check if that fixes it for you by manually installing the attached Library (unzip it and copy it to your Arduino/libraries folder). If so I will release a new library version and publish it to the Arduino and the Platform IO repository.

MAX3010x-Sensor-Library-compilation-fixes.zip

Surbyte commented 2 years ago

The sketch works Ok. I am trying to understand outputs comparing with Sparkfun examples. Thanks!!.

devxplained commented 2 years ago

Glad I could help. If you need more information on how to use the library or how to detect heart beats and do pulse oximetry, you might find it helpful to read the corresponding tutorial series:

Please note, that not all sensors support all LEDs. The MAX30105PulseoximeterMultiLED example you tried is for the MAX30105. The MAX30102 e.g. has no green LED. It is so similar that it will still work, however, the last two values will contain garbage. Just replace MAX30105 with MAX30102 to write code specific for this sensor.

Technerder commented 2 years ago

Hi, I just recently found this library (only one that worked for my MAX30101!)/issue and wanted to test out the example code in part 4 but I was unable to get the code for the filters.h file as the button your website (tested with Firefox and Chrome) doesn't seem to work, also are there any plans to include the examples from your blog into the examples that are shipped with the Arduino library (mainly for detecting heart rate and SpO2 values)?

devxplained commented 2 years ago

I opened a separate issue for this. The website should work now.

Technerder commented 2 years ago

Awesome, thank you so much!