adafruit_bmp3xx

CircuitPython driver from BMP388 Temperature and Barometric Pressure sensor.

  • Author(s): Carter Nelson

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_bmp3xx.BMP3XX

Base class for BMP3XX sensor.

altitude

The altitude in meters based on the currently set sea level pressure.

filter_coefficient

The IIR filter coefficient.

pressure

The pressure in hPa.

pressure_oversampling

The pressure oversampling setting.

reset()

Perform a power on reset. All user configuration settings are overwritten with their default state.

temperature

The temperature in degrees Celsius

temperature_oversampling

The temperature oversampling setting.

class adafruit_bmp3xx.BMP3XX_I2C(i2c, address=119)

Driver for I2C connected BMP3XX.

Parameters:
  • i2c (I2C) – The I2C bus the BMP388 is connected to.
  • address (int) – I2C device address. Defaults to 0x77. but another address can be passed in as an argument

Quickstart: Importing and using the BMP388

Here is an example of using the BMP3XX_I2C class. First you will need to import the libraries to use the sensor

import board
import adafruit_bmp3xx

Once this is done you can define your board.I2C object and define your sensor object

i2c = board.I2C()   # uses board.SCL and board.SDA
bmp = adafruit_bmp3xx.BMP3XX_I2C(i2c)

Now you have access to the temperature and pressure attributes

temperature = bmp.temperature
pressure = bmp.pressure
class adafruit_bmp3xx.BMP3XX_SPI(spi, cs)

Driver for SPI connected BMP3XX.

Parameters:

Quickstart: Importing and using the BMP388

Here is an example of using the BMP3XX_SPI class. First you will need to import the libraries to use the sensor

import board
import adafruit_bmp3xx
from digitalio import DigitalInOut, Direction

Once this is done you can define your board.SPI object and define your sensor object

spi = board.SPI()
cs = DigitalInOut(board.D5)
bmp = adafruit_bmp3xx.BMP3XX_SPI(spi, cs)

Now you have access to the temperature and pressure attributes

temperature = bmp.temperature
pressure = bmp.pressure