Releases: n-elia/MAX30102-MicroPython-driver
Releases · n-elia/MAX30102-MicroPython-driver
v0.5.1
This release modernizes the project's distribution pipeline. No changes to the driver itself.
What's new
- Precompiled .mpy install path. On MicroPython v1.23+, you can now install bytecode-compiled artifacts for faster import and lower RAM footprint at load time:
mpremote mip install github:n-elia/MAX30102-MicroPython-driver/package_mpy.json - The
.mpyfiles are built automatically by CI on every release and attached as release assets. They target the current.mpyv6.3 ABI. - Source
mipinstall still works as before for any MicroPython version that supportsmip(v1.19+):mpremote mip install github:n-elia/MAX30102-MicroPython-driver
What's removed
- PyPI distribution dropped. The pip install micropython-max30102 path is no longer maintained; the last PyPI version is v0.4.2. MicroPython's official package manager is
mip, and PyPI added little value for a device-only library.setup.pyand the legacysdist_upip.pyhave been removed from the repo. upipinstall path dropped from the README.upipwas deprecated in favor ofmipin MicroPython v1.20.
v0.5.0
This release bundles bug fixes plus example and documentation updates.
Two changes are breaking: please read carefully before upgrading.
Breaking changes
set_pulse_amplitude_it()renamed toset_pulse_amplitude_ir(). The old name was a typo; LED2 is the IR LED. No backwards-compatible alias is provided. Callers using the old name must update.fifo_bytes_to_int()bit-shift direction fixed. The previous implementation shifted in the wrong direction, silently corrupting raw readings wheneverpulse_width != 0. The new formula is(value & 0x3FFFF) >> (3 - pulse_width), which matches the MAX30102 datasheet's left-justified FIFO layout. Raw sample magnitudes will change for the same physical input: downstream calibration (SpO2 thresholds, HR algorithm tuning, etc.) may need to be re-checked.
Other changes
check()now drains the full sensor FIFO per call instead of returning after the first sample. Code pollingcheck()in a tight loop should drain the storage queue with awhile sensor.available():loop instead ofif sensor.available():, otherwise samples will accumulate between polls. The bundled examples (examples/basic_usage/main.pyandexamples/heart_rate/main.py) have been updated to use the new pattern.
Upgrade checklist
- Replace any call to
set_pulse_amplitude_it(...)withset_pulse_amplitude_ir(...). - If you build on raw
red/IR/greenmagnitudes (peak detection, fixed thresholds, SpO2 lookup tables), re-verify them as the absolute values change whenpulse_width != 0. - Replace
if sensor.available():withwhile sensor.available():in your polling loop.
Credits
Thanks to @sakluk for spotting and fixing all three issues in #26.
v0.4.2
v0.4.1
v0.4.0
Changelog:
- According to some best practices discussed here, some changes have been made.
- Removed the I2C scan at instantiation time, so that the sensor object could be instantiated even if the sensor
is not available at the moment. - Removed the part ID checks at instantiation time, so that the user may skip them saving time.
- Removed the I2C scan at instantiation time, so that the sensor object could be instantiated even if the sensor
- The example has been updated, and default values now provide better results.
v0.3.6
v0.3.5
Changelog:
- A
SoftI2Cinstance is now required by the constructor. - The constructor now raises
RuntimeErrorwhen the sensor is not found on I2C bus. - The example has been updated to intercept the errors thrown by the constructor.
- The example has been updated to estimate real acquisition frequency with a precision of 1 microsecond.
- The readme has been re-organized to improve readability.