CircuitPython BMP581 Driver¶
bmp581
¶
CircuitPython Driver for the Bosch BMP581 pressure sensor
Author(s): Jose D. Montoya
-
class bmp581.BMP581(i2c_bus: busio.I2C, address: int =
0x47
)[source]¶ Driver for the BMP581 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
BMP581
class. First you will need to import the libraries to use the sensorimport board import bmp581
Once this is done you can define your
board.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA bmp = bmp581.BMP581(i2c)
Now you have access to the attributes
press = bmp.pressure
- property altitude¶
With the measured pressure p and the pressure at sea level p0 e.g. 1013.25hPa, the altitude in meters can be calculated with the international barometric formula
With the measured pressure p and the absolute altitude the pressure at sea level can be calculated too. See the altitude setter for this calculation
- 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
bmp581.STANDBY
0x00
bmp581.NORMAL
0x01
bmp581.FORCED
0x02
bmp581.NON_STOP
0X03