adafruit_lps2x

Library for the ST LPS2X family of pressure sensors

  • Author(s): Bryan Siepert

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_lps2x.Rate

Options for data_rate

Rate

Description

Rate.LPS25_SHUTDOWN

Setting data_rate to Rate.LPS25_SHUTDOWN stops measurements from being taken

Rate.LPS25_RATE_1_HZ

1 Hz

Rate.LPS25_RATE_7_HZ

7 Hz

Rate.LPS25_RATE_12_5_HZ

12.5 Hz

Rate.LPS25_RATE_25_HZ

25 Hz

Rate.LPS22_SHUTDOWN

Setting data_rate to Rate.LPS22_SHUTDOWN stops measurements from being taken

Rate.LPS22_RATE_1_HZ

1 Hz

Rate.LPS22_RATE_10_HZ

10 Hz

Rate.LPS22_RATE_25_HZ

25 Hz

Rate.LPS22_RATE_50_HZ

50 Hz

Rate.LPS22_RATE_75_HZ

75 Hz

class adafruit_lps2x.LPS2X(i2c_bus: I2C, address: int = 93, chip_id: int = -1)

Base class ST LPS2x family of pressure sensors

Parameters:
  • i2c_bus (I2C) – The I2C bus the sensor is connected to.

  • address (int) – The I2C device address for the sensor. Default is 0x5d but will accept 0x5c when the SDO pin is connected to Ground.

initialize() None

Configure the sensor with the default settings. For use after calling reset()

reset() None

Reset the sensor, restoring all configuration registers to their defaults

property pressure: float

The current pressure measurement in hPa

property temperature: float

The current temperature measurement in degrees Celsius

property data_rate: int

The rate at which the sensor measures pressure and temperature. data_rate should be set to one of the values of adafruit_lps2x.Rate

class adafruit_lps2x.LPS25(i2c_bus: I2C, address: int = 93)

Library for the ST LPS25 pressure sensors

Parameters:
  • i2c_bus (I2C) – The I2C bus the LPS25HB is connected to.

  • address (int) – The I2C device address. Default is 0x5d but will accept 0x5c when the SDO pin is connected to Ground.

enabled

Controls the power down state of the sensor. Setting to False will shut the sensor down

initialize() None

Configure the sensor with the default settings. For use after calling LPS2X.reset()

class adafruit_lps2x.LPS22(i2c_bus: I2C, address: Literal[92, 93] = 93)

Library for the ST LPS22 pressure sensors

Parameters:
  • i2c_bus (I2C) – The I2C bus the LPS22HB is connected to.

  • address – The I2C device address. Default is 0x5d but will accept 0x5c when the SDO pin is connected to Ground.

initialize() None

Configure the sensor with the default settings. For use after calling LPS2X.reset()