vrano714 / max30102-tutorial-raspberrypi

This repository is unofficial porting of Arduino sample code of MAXRESDEF117#(max30102) HR/SpO2 sensor
56 stars 28 forks source link

calculate heart rate and spo2 #1

Closed talal44 closed 6 years ago

talal44 commented 6 years ago

Thank you for the great code. did you manage to calculate the heart rate and spo2 in python yet?

vrano714 commented 6 years ago

Thank you for viewing this repo. Currently, the codes do not have the functions to calculate HR and SpO2.

The original Arduino codes do some pointer-based operations to work with small memory and little bit confusing. I did not convert HR/SpO2 calculation because I wanted to open this repo ASAP.

However, I need HR/SpO2 calculation, so I am planning to convert. I hope I can update soon, but writing may take longer.

vrano714 commented 6 years ago

Hi @talal44, I just posted a file which contains HR / SpO2 calculation.

The resulting value is sometimes different from original algorithm, but same in most cases.

I hope it works in your environment. Thank you.

doug-burrell commented 5 years ago

I've been using this code and I've found a bug in the max30102.py file: you've mixed up the red and ir LEDs in the read FIFO function. The red led is led1 and the ir led is led2.

vrano714 commented 5 years ago

Thanks @doug-burrell ! I confirmed that reading values from the list of read data was wrong.

doug-burrell commented 5 years ago

You're welcome :)