API Reference
adafruit_mprls
CircuitPython library to support Honeywell MPRLS digital pressure sensors
Author(s): ladyada
Implementation Notes
Hardware:
Adafruit Adafruit MPRLS Ported Pressure Sensor Breakout (Product ID: 3965)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_mprls.MPRLS(i2c_bus: I2C, *, addr: int = 24, reset_pin: DigitalInOut | None = None, eoc_pin: DigitalInOut | None = None, psi_min: int = 0, psi_max: int = 25)
Driver base for the MPRLS pressure sensor
- Parameters:
i2c_bus (I2C) – The I2C bus the MPRLS is connected to
addr (int) – The I2C device address. Defaults to
0x18reset_pin (Pin) – Optional
digitalio.pinfor hardware resettingeoc_pin (Pin) – Optional
digitalio pinfor getting End Of Conversion signalpsi_min (float) – The minimum pressure in PSI, defaults to
0psi_max (float) – The maximum pressure in PSI, defaults to
25
Quickstart: Importing and using the MPRLS
Here is an example of using the
MPRLSclass. First you will need to import the libraries to use the sensorimport board import adafruit_mprls
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA mpr = adafruit_mprls.MPRLS(i2c, psi_min=0, psi_max=25)
Now you have access to the
pressureattributepressure = mpr.pressure