LPS28 Library¶
lps28¶
LPS28 pressure sensor drive for CircuitPython
Author(s): Jose D. Montoya
-
class lps28.LPS28(i2c_bus: busio.I2C, address: int =
0x5D)[source]¶ Driver for the LPS28 Sensor connected over I2C.
- Parameters:¶
- Raises:¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
LPS28class. First you will need to import the libraries to use the sensorimport board import lps28Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA lps28 = LPS28.lps28(i2c)Now you have access to the attributes
press = lps28.pressure- property data_rate : str¶
Sensor data_rate
Mode
Value
lps28.ONE_SHOT0b0000lps28.RATE_1_HZ0b0001lps28.RATE_4_HZ0b0010lps28.RATE_10_HZ0b0011lps28.RATE_25_HZ0b0100lps28.RATE_50_HZ0b0101lps28.RATE_75_HZ0b0110lps28.RATE_100_HZ0b0111lps28.RATE_200_HZ0b1000
- property full_scale : None¶
Sensor full_scale (0: mode 1, full scale up to 1260 hPa; 1: mode 2, full scale up to 4060 hPa)
Mode
Value
lps28.FULL_SCALE0b1lps28.NORMAL0b0
- property high_threshold_enabled : bool¶
Set to
TrueorFalseto enable or disable the high pressure threshold
- property high_threshold_exceeded : bool¶
Returns
Trueif the pressure high threshold has been exceeded. Must be enabled by settinghigh_threshold_enabledtoTrueand setting apressure_threshold.
- property low_threshold_enabled : bool¶
Set to
TrueorFalseto enable or disable the low pressure threshold.
- property low_threshold_exceeded : bool¶
Returns
Trueif the pressure low threshold has been exceeded. Must be enabled by settinghigh_threshold_enabledtoTrueand setting apressure_threshold.
- property pressure_threshold : float¶
The high pressure threshold. Use
high_threshold_enabledorhigh_threshold_enabledto use it