MicroPython MMR920 Library

mmr902

MicroPython Driver fro the Mitsumi MMR902 Micro Pressure Sensor

  • Author(s): Jose D. Montoya

class micropython_mmr902.mmr902.MMR902(i2c, address: int = 0x65)[source]

Driver for the MMR902 Sensor connected over I2C.

Parameters:
i2c : I2C

The I2C bus the MMR902 is connected to.

address : int

The I2C device address. Defaults to 0x65

Raises:

RuntimeError – if the sensor is not found

Quickstart: Importing and using the device

Here is an example of using the MMR902 class. First you will need to import the libraries to use the sensor

from machine import Pin, I2C
from micropython_mmr902 import mmr902

Once this is done you can define your machine.I2C object and define your sensor object

i2c = I2C(1, sda=Pin(2), scl=Pin(3))
mmr = mmr902.MMR902(i2c)

Now you have access to the attributes

temp = mmr.temperature
property operation_mode : str

Sensor operation_mode

Mode

Value

mmr902.MODE1

0XA0

mmr902.MODE2

0XA2

mmr902.MODE3

0XA4

mmr902.MODE4

0XA6

property pressure : float

Pressure in mmHg

property temperature : float

Temperature in Celsius