bmp384¶
CircuitPython Driver for the Bosch BMP384 Pressure and Temperature sensor
Author(s): Jose D. Montoya
-
class bmp384.BMP384(i2c_bus: busio.I2C, address: int =
0x77)[source]¶ Driver for the BMP384 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
BMP384class. First you will need to import the libraries to use the sensorimport board import bmp384Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA bmp = bmp384.BMP384(i2c)Now you have access to the attributes
press = bmp.pressure temp = bmp.temperature- property filter_coefficients : str¶
Sensor filter_coefficients
Mode
Value
bmp384.IIR_FILTER_DISABLE0x00bmp384.IIR_FILTER_X20x01bmp384.IIR_FILTER_X40x02bmp384.IIR_FILTER_X80x03bmp384.IIR_FILTER_X160x04bmp384.IIR_FILTER_X320x05bmp384.IIR_FILTER_X640x06bmp384.IIR_FILTER_X1280x07
- property output_data_rate : int¶
Sensor output_data_rate. for a complete list of values please see the datasheet
- property power_mode : str¶
Sensor power_mode
Mode
Value
bmp384.SLEEP_MODE0b00bmp384.FORCED_MODE0b10bmp384.NORMAL_MODE0b11
- property pressure_mode : str¶
Sensor pressure_mode
Mode
Value
bmp384.PRESS_DISABLE0x00bmp384.PRESS_ENABLE0x01
- property pressure_oversample : str¶
Sensor pressure_oversample
Mode
Value
bmp384.OVERSAMPLE_DISABLE0x00bmp384.OVERSAMPLE_X20x01bmp384.OVERSAMPLE_X40x02bmp384.OVERSAMPLE_X80x03bmp384.OVERSAMPLE_X160x04bmp384.OVERSAMPLE_X320x05