oxullo / Arduino-MAX30100

Arduino library for MAX30100, integrated oximeter and heart rate sensor
GNU General Public License v3.0
190 stars 134 forks source link

My GY-MAX30100 pulse oximeter issue with Arduino Uno. #88

Open Tomzzia opened 1 year ago

Tomzzia commented 1 year ago

Arduino hardware: 1.18.19 OXIMETER ARDUINO UNO VIN 5V GND GND SCL SCL SDA SDA

But in the Serial Monitor is "Initializing pulse oximeter..." and GY-MAX30100 isn't work

322830086_932133411277641_1652493572594300088_n

My code:

include

include "MAX30100_PulseOximeter.h"

define REPORTING_PERIOD_MS 1000

PulseOximeter pox; uint32_t tsLastReport = 0;

void onBeatDetected() { Serial.println("Beat!"); }

void setup()

{ Serial.begin(115200); Serial.print("Initializing pulse oximeter..");

if (!pox.begin()) {
    Serial.println("FAILED");
    for(;;);
} else {
    Serial.println("SUCCESS");
}
 pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

pox.setOnBeatDetectedCallback(onBeatDetected);

}

void loop() {

pox.update();
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();
}

}

mediocre9 commented 1 year ago

is their any solution to this problem?