diff --git a/adafruit_lps35hw.py b/adafruit_lps35hw.py index bd6efef..33f1293 100644 --- a/adafruit_lps35hw.py +++ b/adafruit_lps35hw.py @@ -114,21 +114,54 @@ class DataRate: # pylint: disable=too-few-public-methods class LPS35HW: # pylint: disable=too-many-instance-attributes """Driver for the ST LPS35HW MEMS pressure sensor - :param ~busio.I2C i2c_bus: The I2C bus the LPS34HW is connected to. - :param address: The I2C device address for the sensor. Default is ``0x5d`` but will accept - ``0x5c`` when the ``SDO`` pin is connected to Ground. + :param ~busio.I2C i2c_bus: The I2C bus the LPS35HW is connected to. + :param int address: The I2C device address for the sensor. Default is :const:`0x5d` + but will accept :const:`0x5c` when the ``SDO`` pin is connected to Ground. + + + **Quickstart: Importing and using the LPS35HW** + + Here is an example of using the :class:`LPS35HW` class. + First you will need to import the libraries to use the sensor + + .. code-block:: python + + import board + import adafruit_lps35hw + + Once this is done you can define your `board.I2C` object and define your sensor object + + .. code-block:: python + + i2c = board.I2C() # uses board.SCL and board.SDA + lps = adafruit_lps35hw.LPS35HW(i2c) + + Now you have access to the :attr:`temperature` and :attr:`pressure` attributes. + Temperature is in Celsius and Pressure is in hPa. + + .. code-block:: python + + temperature = lps.temperature + pressure = lps.pressure + """ data_rate = RWBits(3, _CTRL_REG1, 4) - """The rate at which the sensor measures ``pressure`` and ``temperature``. ``data_rate`` should - be set to one of the values of ``adafruit_lps35hw.DataRate``. Note that setting ``data_rate`` - to ``DataRate.ONE_SHOT`` places the sensor into a low-power shutdown mode where measurements to - update ``pressure`` and ``temperature`` are only taken when ``take_measurement`` is called.""" + """The rate at which the sensor measures :attr:`pressure` and :attr:`temperature`. + ``data_rate`` should be set to one of the values of :meth:`adafruit_lps35hw.DataRate`. + + .. note:: + Setting ``data_rate`` to :const:`DataRate.ONE_SHOT` places the sensor + into a low-power shutdown mode where measurements to update + :attr:`pressure` and :attr:`temperature` are only taken + when :meth:`take_measurement` is called. + + """ low_pass_enabled = RWBit(_CTRL_REG1, 3) """True if the low pass filter is enabled. Setting to `True` will reduce the sensor bandwidth - from ``data_rate/2`` to ``data_rate/9``, filtering out high-frequency noise.""" + from :math:`data_rate/2` to :math:`data_rate/9`, filtering out high-frequency noise.""" _raw_temperature = UnaryStruct(_TEMP_OUT_L, " + .. toctree:: :caption: Related Products + Adafruit LPS33/LPS35 Water Resistant Pressure Sensor + .. toctree:: :caption: Other Links