|
15 | 15 |
|
16 | 16 | **Hardware:** |
17 | 17 |
|
| 18 | +* Adafruit `Adafruit MPRLS Ported Pressure Sensor Breakout |
| 19 | + <https://www.adafruit.com/product/3965>`_ (Product ID: 3965) |
| 20 | +
|
18 | 21 | **Software and Dependencies:** |
19 | 22 |
|
20 | 23 | * Adafruit CircuitPython firmware for the supported boards: |
21 | | - https://github.com/adafruit/circuitpython/releases |
| 24 | + https://circuitpython.org/downloads |
22 | 25 |
|
23 | 26 | * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
24 | 27 |
|
|
41 | 44 | class MPRLS: |
42 | 45 | """ |
43 | 46 | Driver base for the MPRLS pressure sensor |
44 | | - :param i2c_bus: The `busio.I2C` object to use. This is the only required parameter. |
45 | | - :param int addr: The optional I2C address, defaults to 0x18 |
46 | | - :param microcontroller.Pin reset_pin: Optional digitalio pin for hardware resetting |
47 | | - :param microcontroller.Pin eoc_pin: Optional digitalio pin for getting End Of Conversion signal |
48 | | - :param float psi_min: The minimum pressure in PSI, defaults to 0 |
49 | | - :param float psi_max: The maximum pressure in PSI, defaults to 25 |
| 47 | +
|
| 48 | + :param ~busio.I2C i2c_bus: The I2C bus the MPRLS is connected to |
| 49 | + :param int addr: The I2C device address. Defaults to :const:`0x18` |
| 50 | + :param ~microcontroller.Pin reset_pin: Optional ``digitalio.pin`` for hardware resetting |
| 51 | + :param ~microcontroller.Pin eoc_pin: Optional ``digitalio pin`` |
| 52 | + for getting End Of Conversion signal |
| 53 | + :param float psi_min: The minimum pressure in PSI, defaults to :const:`0` |
| 54 | + :param float psi_max: The maximum pressure in PSI, defaults to :const:`25` |
| 55 | +
|
| 56 | + **Quickstart: Importing and using the MPRLS** |
| 57 | +
|
| 58 | + Here is an example of using the :class:`MPRLS` class. |
| 59 | + First you will need to import the libraries to use the sensor |
| 60 | +
|
| 61 | + .. code-block:: python |
| 62 | +
|
| 63 | + import board |
| 64 | + import adafruit_mprls |
| 65 | +
|
| 66 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 67 | +
|
| 68 | + .. code-block:: python |
| 69 | +
|
| 70 | + i2c = board.I2C() # uses board.SCL and board.SDA |
| 71 | + mpr = adafruit_mprls.MPRLS(i2c, psi_min=0, psi_max=25) |
| 72 | +
|
| 73 | + Now you have access to the :attr:`pressure` attribute |
| 74 | +
|
| 75 | + .. code-block:: python |
| 76 | +
|
| 77 | + pressure = mpr.pressure |
| 78 | +
|
50 | 79 | """ |
51 | 80 |
|
52 | 81 | def __init__( |
|
0 commit comments