Hi all
How to fix this error please?
thanks
Adam
#include <Wire.h>
#include "MAX30100_PulseOximeter.h"
#define REPORTING_PERIOD_MS 1000
// Create a PulseOximeter object
PulseOximeter pox;
// Time at which the last beat occurred
uint32_t tsLastReport = 0;
// Callback routine is executed when a pulse is detected
void onBeatDetected() {
Serial.println("♥ Beat!");
}
void setup() {
Serial.begin(115200);
Serial.print("Initializing pulse oximeter..");
Wire.begin(43,44); /// added for ESP32
/// pox.begin(); /// O
pox.begin(0x57, &Wire) /// MDF for I2C
// Initialize sensor
/* if (!pox.begin()) {
Serial.println("FAILED");
for(;;);
} else {
Serial.println("SUCCESS");
} */
// Configure sensor to use 7.6mA for LED drive
pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);
// Register a callback routine
pox.setOnBeatDetectedCallback(onBeatDetected);
}
void loop() {
// Read from the sensor
Serial.print("loop!!!");
pox.update();
/// pox.update(0x76, &Wire);
// Grab the updated heart rate and SpO2 levels
if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
Serial.print("Heart rate:");
Serial.print(pox.getHeartRate());
Serial.print("bpm / SpO2:");
Serial.print(pox.getSpO2());
Serial.println("%");
tsLastReport = millis();
}
}
ERROR:
Arduino: 1.8.19 (Windows 10), Board: "ESP32S3 Dev Module, Disabled, Disabled, QIO 80MHz, 4MB (32Mb), Core 1, Core 1, Hardware CDC and JTAG, Disabled, Disabled, Disabled, UART0 / Hardware CDC, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi), 921600, None, Disabled"
C:\Users\summe\OneDrive\Documents\Arduino\ESP32_MAX30100_HRS_BO_N1\ESP32_MAX30100_HRS_BO_N1.ino: In function 'void setup()':
ESP32_MAX30100_HRS_BO_N1:40:23: error: no matching function for call to 'PulseOximeter::begin(int, TwoWire*)'
pox.begin(0x76, &Wire) /// MDF for I2C
^
In file included from C:\Users\summe\OneDrive\Documents\Arduino\ESP32_MAX30100_HRS_BO_N1\ESP32_MAX30100_HRS_BO_N1.ino:19:
C:\Users\summe\OneDrive\Documents\Arduino\libraries\Arduino-MAX30100-master\src/MAX30100_PulseOximeter.h:53:10: note: candidate: 'bool PulseOximeter::begin(PulseOximeterDebuggingMode)'
bool begin(PulseOximeterDebuggingMode debuggingMode_=PULSEOXIMETER_DEBUGGINGMODE_NONE);
^~~~~
C:\Users\summe\OneDrive\Documents\Arduino\libraries\Arduino-MAX30100-master\src/MAX30100_PulseOximeter.h:53:10: note: candidate expects 1 argument, 2 provided
Multiple libraries were found for "MAX30100_PulseOximeter.h"
Used: C:\Users\summe\OneDrive\Documents\Arduino\libraries\Arduino-MAX30100-master
Not used: C:\Users\summe\OneDrive\Documents\Arduino\libraries\MAX30100lib
exit status 1
no matching function for call to 'PulseOximeter::begin(int, TwoWire*)'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.