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, *, addr=24, reset_pin=None, eoc_pin=None, psi_min=0, psi_max=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
0x18
reset_pin (Pin) – Optional
digitalio.pin
for hardware resettingeoc_pin (Pin) – Optional
digitalio pin
for getting End Of Conversion signalpsi_min (float) – The minimum pressure in PSI, defaults to
0
psi_max (float) – The maximum pressure in PSI, defaults to
25
Quickstart: Importing and using the MPRLS
Here is an example of using the
MPRLS
class. 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.I2C
object 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
pressure
attributepressure = mpr.pressure
- property pressure¶
The measured pressure, in hPa