

The library provides a method to setup the sensor at once. The I2C pin numbers depend on the board that you are using, and how you wired the sensor to it. 2 - I2C setup and sensor configuration I2C connectionĬreate a SoftI2C instance as in the following example: from machine import SoftI2C, Pin my_SDA_pin = 21 # I2C SDA pin number here! my_SCL_pin = 22 # I2C SCL pin number here! my_i2c_freq = 400000 # I2C frequency (Hz) here! i2c = SoftI2C ( sda = Pin ( my_SDA_pin ), scl = Pin ( my_SCL_pin ), freq = my_i2c_freq ) sensor = MAX30102 ( i2c = i2c ) Upload, press the reset button of your board are you're good to go. example directory content into your microcontroller. example folder, copy max30102/circular_buffer.py and max30102/_init_.py into Then, import the constructor as follows: from max30102 import MAX30102 To directly include the library into a MicroPython project, it's sufficient to copy max30102/circular_buffer.pyĪnd max30102/_init_.py next to your main.py file, into a lib directory. 1b - manual way (no Internet access required)
#UTIME RESETTING INSTALL#
If you prefer, you can perform a manual install as explained below. exampleĬontent into your microcontroller. example folder, please set your WiFi credentials in boot.py and then upload. If your MicroPython version supports upip package manager, put these lines after the setup of an Internet connection: import upip upip. install ( "github:n-elia/MAX30102-MicroPython-driver" ) If your MicroPython version supports mip package manager, put these lines after the setup of an Internet connection: import mip mip. Please use the package manager included into your MicroPython version. This module is compatible with both of them. Warning: in latest MicroPython releases upip has been deprecated in favor of mip. 1 - Including this library into your project 1a - network-enabled MicroPython ports You just need to import the library, and to set up a SoftI2C instance.Ī full example is provided in /example directory. Usageĭriver usage is quite straightforward. Please do not rely on it for medical purposes or professional usage. This work is not intended to be used in professional environments, and there are no guarantees on its functionalities. 1b - manual way (no Internet access required).1 - Including this library into your project.

If you have the chance to test this library with a MAX30105, please leave yourįeedback in the Discussions section.
#UTIME RESETTING DRIVER#
A port of the SparkFun driver for Maxim MAX30102 sensor to MicroPython.
