How to adapt a python library to micropython?

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
sim222
Posts: 20
Joined: Wed Nov 27, 2019 12:04 am

Re: How to adapt a python library to micropython?

Post by sim222 » Tue Mar 23, 2021 2:56 am

aroca wrote:
Sun May 03, 2020 12:53 am
Hi!

I also needed MAX30100 for MicroPython, and this discussion helped a lot to implement a working script to read this sensor. I forked from the repository mentioned in the first post of this discussion, and made all needed changes. Also added a working example. Tested nicely with ESP8266.

The code is hrere:

https://github.com/rafaelaroca/max30100

Best regards, and thanks for the discussion presented here!

[]s Rafael.
WoW great post for me!!

get great idea regarding how to convert RP lib to uP lib!!

electronics
Posts: 1
Joined: Fri May 14, 2021 7:01 pm

Re: How to adapt a python library to micropython?

Post by electronics » Fri May 14, 2021 7:08 pm

Hello aroca
Hope you are doing great.

I have been working on this max30100 sensor, ESP32 & micropython for a project. I found an excellent library developed by you in micropython, which you stated that you Forked from mfitzp/max30100.
I appreciate your excellent work and efforts.
I am succeeded to upload test.py code esp32 alongside the max30100.py library. after completion of uploading it is giving some data as follows.
10064 14920
10280 15096
9872 12944
9864 12912
Here I didn't understand what is this data. from the code, I came to know that this data is (sensor.ir, sensor.red)

but I didn't understand how to get the SPO2 data and heart rate data from these values.
basically, spo2 data will be in 0% to 100% format. and Heart rate 60 to 100 beats. I want my final data to be in this format.

Please let me know how can I derive final values from raw data.

Thank you.

Post Reply