Qwiic_BME280_Py
Python for SFE Qwiic BME280
Loading...
Searching...
No Matches
qwiic_bme280.QwiicBme280 Class Reference

QwiicBme280. More...

Inheritance diagram for qwiic_bme280.QwiicBme280:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 
def is_connected (self)
 Determine if a BME280 device is conntected to the system. More...
 
def begin (self)
 Initialize the operation of the BME280 module. More...
 
def set_mode (self, mode)
 Set the operational mode of the sensor. More...
 
def get_mode (self)
 Returns the operational mode of the sensor. More...
 
def set_standby_time (self, timeSetting)
 Set the standby bits in the BME280s config register. More...
 
def set_filter (self, filterSetting)
 Set the filter bits in the BME280s config register. More...
 
def set_tempature_oversample (self, overSampleAmount)
 Set the temperature oversample value. More...
 
def set_pressure_oversample (self, overSampleAmount)
 Set the pressure oversample value. More...
 
def set_humidity_oversample (self, overSampleAmount)
 Set the humidity oversample value. More...
 
def check_sample_value (self, userValue)
 Validates an over sample value. More...
 
def is_measuring (self)
 Return if the sensor is measuring or not. More...
 
def reset (self)
 Resets the sensor. More...
 
def read_pressure (self)
 Returns pressure in Pa. More...
 
def set_reference_pressure (self, refPressure)
 Sets the referance pressure for the sensor measurments. More...
 
def get_reference_pressure (self)
 Get the current reference pressure for the sensor. More...
 
def get_altitude_meters (self)
 Return the current Altitude in meters. More...
 
def get_altitude_feet (self)
 Return the current Altitude in feet. More...
 
def read_humidity (self)
 Returns humidity in RH. More...
 
def get_temperature_celsius (self)
 Returns temperature in DegC and updates t_fine (needed for accurate pressure and humidity measurements) More...
 
def get_temperature_fahrenheit (self)
 Returns temperature in Deg F and updates t_fine (needed for accurate pressure and humidity measurements) More...
 
def get_dewpoint_celsius (self)
 Returns the Dew point in degrees C. More...
 
def get_dewpoint_fahrenheit (self)
 Returns the Dew point in degrees F. More...
 

Public Attributes

 address
 
 calibration
 
 t_fine
 

Static Public Attributes

 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int MODE_SLEEP = 0b00
 
int MODE_FORCED = 0b01
 
int MODE_NORMAL = 0b11
 
int BME280_DIG_T1_LSB_REG = 0x88
 
int BME280_DIG_T1_MSB_REG = 0x89
 
int BME280_DIG_T2_LSB_REG = 0x8A
 
int BME280_DIG_T2_MSB_REG = 0x8B
 
int BME280_DIG_T3_LSB_REG = 0x8C
 
int BME280_DIG_T3_MSB_REG = 0x8D
 
int BME280_DIG_P1_LSB_REG = 0x8E
 
int BME280_DIG_P1_MSB_REG = 0x8F
 
int BME280_DIG_P2_LSB_REG = 0x90
 
int BME280_DIG_P2_MSB_REG = 0x91
 
int BME280_DIG_P3_LSB_REG = 0x92
 
int BME280_DIG_P3_MSB_REG = 0x93
 
int BME280_DIG_P4_LSB_REG = 0x94
 
int BME280_DIG_P4_MSB_REG = 0x95
 
int BME280_DIG_P5_LSB_REG = 0x96
 
int BME280_DIG_P5_MSB_REG = 0x97
 
int BME280_DIG_P6_LSB_REG = 0x98
 
int BME280_DIG_P6_MSB_REG = 0x99
 
int BME280_DIG_P7_LSB_REG = 0x9A
 
int BME280_DIG_P7_MSB_REG = 0x9B
 
int BME280_DIG_P8_LSB_REG = 0x9C
 
int BME280_DIG_P8_MSB_REG = 0x9D
 
int BME280_DIG_P9_LSB_REG = 0x9E
 
int BME280_DIG_P9_MSB_REG = 0x9F
 
int BME280_DIG_H1_REG = 0xA1
 
int BME280_CHIP_ID_REG = 0xD0
 
int BME280_RST_REG = 0xE0
 
int BME280_DIG_H2_LSB_REG = 0xE1
 
int BME280_DIG_H2_MSB_REG = 0xE2
 
int BME280_DIG_H3_REG = 0xE3
 
int BME280_DIG_H4_MSB_REG = 0xE4
 
int BME280_DIG_H4_LSB_REG = 0xE5
 
int BME280_DIG_H5_MSB_REG = 0xE6
 
int BME280_DIG_H6_REG = 0xE7
 
int BME280_CTRL_HUMIDITY_REG = 0xF2
 
int BME280_STAT_REG = 0xF3
 
int BME280_CTRL_MEAS_REG = 0xF4
 
int BME280_CONFIG_REG = 0xF5
 
int BME280_PRESSURE_MSB_REG = 0xF7
 
int BME280_PRESSURE_LSB_REG = 0xF8
 
int BME280_PRESSURE_XLSB_REG = 0xF9
 
int BME280_TEMPERATURE_MSB_REG = 0xFA
 
int BME280_TEMPERATURE_LSB_REG = 0xFB
 
int BME280_TEMPERATURE_XLSB_REG = 0xFC
 
int BME280_HUMIDITY_MSB_REG = 0xFD
 
int BME280_HUMIDITY_LSB_REG = 0xFE
 

Properties

 connected = property(is_connected)
 
 mode = property(get_mode, set_mode)
 
 standby_time = property()
 
 filter = property()
 
 tempature_oversample = property()
 
 pressure_oversample = property()
 
 humidity_oversample = property()
 
 pressure = property(read_pressure)
 
 reference_pressure = property(get_reference_pressure, set_reference_pressure)
 
 altitude_meters = property(get_altitude_meters)
 
 altitude_feet = property(get_altitude_feet)
 
 humidity = property(read_humidity)
 
 temperature_celsius = property(get_temperature_celsius)
 
 temperature_fahrenheit = property(get_temperature_fahrenheit)
 
 dewpoint_celsius = property(get_dewpoint_celsius)
 
 dewpoint_fahrenheit = property(get_dewpoint_fahrenheit)
 

Detailed Description

QwiicBme280.

Parameters
addressThe I2C address to use for the device. If not provided, the default address is used.
i2c_driverAn existing i2c driver object. If not provided a driver object is created.
Returns
Object The BME280 device object.

Constructor & Destructor Documentation

◆ __init__()

def qwiic_bme280.QwiicBme280.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Member Function Documentation

◆ begin()

def qwiic_bme280.QwiicBme280.begin (   self)

Initialize the operation of the BME280 module.

Returns
bool Returns true of the initializtion was successful, otherwise False.

◆ check_sample_value()

def qwiic_bme280.QwiicBme280.check_sample_value (   self,
  userValue 
)

Validates an over sample value.

Parameters
userValueThe oversample value to check. Allowed values are 0 to 16 These are used in the humidty, pressure, and temp oversample functions
Returns
int Valid oversample value

◆ get_altitude_feet()

def qwiic_bme280.QwiicBme280.get_altitude_feet (   self)

Return the current Altitude in feet.

Returns
float The current altitude in feets

◆ get_altitude_meters()

def qwiic_bme280.QwiicBme280.get_altitude_meters (   self)

Return the current Altitude in meters.

Returns
float The current altitude in meters

◆ get_dewpoint_celsius()

def qwiic_bme280.QwiicBme280.get_dewpoint_celsius (   self)

Returns the Dew point in degrees C.

Returns
float The current dewpoint in C.

◆ get_dewpoint_fahrenheit()

def qwiic_bme280.QwiicBme280.get_dewpoint_fahrenheit (   self)

Returns the Dew point in degrees F.

Returns
float The current dewpoint in F.

◆ get_mode()

def qwiic_bme280.QwiicBme280.get_mode (   self)

Returns the operational mode of the sensor.

Returns
MODE_SLEEP, MODE_FORCED, or MODE_NORMAL The current operational mode

◆ get_reference_pressure()

def qwiic_bme280.QwiicBme280.get_reference_pressure (   self)

Get the current reference pressure for the sensor.

Returns
float The current reference pressure.

◆ get_temperature_celsius()

def qwiic_bme280.QwiicBme280.get_temperature_celsius (   self)

Returns temperature in DegC and updates t_fine (needed for accurate pressure and humidity measurements)

Returns
float The current temperature in C.

◆ get_temperature_fahrenheit()

def qwiic_bme280.QwiicBme280.get_temperature_fahrenheit (   self)

Returns temperature in Deg F and updates t_fine (needed for accurate pressure and humidity measurements)

Returns
float The current temperature in F.

◆ is_connected()

def qwiic_bme280.QwiicBme280.is_connected (   self)

Determine if a BME280 device is conntected to the system.

Returns
bool True if the device is connected, otherwise False.

◆ is_measuring()

def qwiic_bme280.QwiicBme280.is_measuring (   self)

Return if the sensor is measuring or not.

Returns
True if the sensor is measuring, else False :rvalue: boolean

◆ read_humidity()

def qwiic_bme280.QwiicBme280.read_humidity (   self)

Returns humidity in RH.

Returns
float The current humidity value

◆ read_pressure()

def qwiic_bme280.QwiicBme280.read_pressure (   self)

Returns pressure in Pa.

Returns
float Pressure in Pa

◆ reset()

def qwiic_bme280.QwiicBme280.reset (   self)

Resets the sensor.

If called, the begin method must be called before using the sensor.

◆ set_filter()

def qwiic_bme280.QwiicBme280.set_filter (   self,
  filterSetting 
)

Set the filter bits in the BME280s config register.

Parameters
filterSettingThe filter bits for the BME280. Acceptable values 0 = filter off 1 = coefficients = 2 2 = coefficients = 4 3 = coefficients = 8 4 = coefficients = 16
Returns
No return value

◆ set_humidity_oversample()

def qwiic_bme280.QwiicBme280.set_humidity_oversample (   self,
  overSampleAmount 
)

Set the humidity oversample value.

Parameters
overSampleAmountThe humidity oversample value. Acceptable values 0 = turns off humidity sensing 1 to 16 are valid over sampling values
Returns
No return value

◆ set_mode()

def qwiic_bme280.QwiicBme280.set_mode (   self,
  mode 
)

Set the operational mode of the sensor.

Parameters
modeOne of the class constant values. MODE_SLEEP, MODE_FORCED, MODE_NORMAL
Returns
No return value

◆ set_pressure_oversample()

def qwiic_bme280.QwiicBme280.set_pressure_oversample (   self,
  overSampleAmount 
)

Set the pressure oversample value.

Parameters
overSampleAmountThe pressure oversample value. Acceptable values 0 = turns off pressure sensing 1 to 16 are valid over sampling values
Returns
No return value

◆ set_reference_pressure()

def qwiic_bme280.QwiicBme280.set_reference_pressure (   self,
  refPressure 
)

Sets the referance pressure for the sensor measurments.

Parameters
refPressureThe referance pressure to use.
Returns
No return value

◆ set_standby_time()

def qwiic_bme280.QwiicBme280.set_standby_time (   self,
  timeSetting 
)

Set the standby bits in the BME280s config register.

Parameters
timeSettingThe standby time bits - acceptable values 0 = 0.5ms 1 = 62.5ms 2 = 125ms 3 = 250ms 4 = 500ms 5 = 1000ms 6 = 10ms 7 = 20ms
Returns
No return value

◆ set_tempature_oversample()

def qwiic_bme280.QwiicBme280.set_tempature_oversample (   self,
  overSampleAmount 
)

Set the temperature oversample value.

Parameters
overSampleAmountThe temperature oversample value. Acceptable values 0 = turns off temp sensing 1 to 16 are valid over sampling values
Returns
No return value

Member Data Documentation

◆ address

qwiic_bme280.QwiicBme280.address

◆ available_addresses

qwiic_bme280.QwiicBme280.available_addresses = _AVAILABLE_I2C_ADDRESS
static

◆ BME280_CHIP_ID_REG

int qwiic_bme280.QwiicBme280.BME280_CHIP_ID_REG = 0xD0
static

◆ BME280_CONFIG_REG

int qwiic_bme280.QwiicBme280.BME280_CONFIG_REG = 0xF5
static

◆ BME280_CTRL_HUMIDITY_REG

int qwiic_bme280.QwiicBme280.BME280_CTRL_HUMIDITY_REG = 0xF2
static

◆ BME280_CTRL_MEAS_REG

int qwiic_bme280.QwiicBme280.BME280_CTRL_MEAS_REG = 0xF4
static

◆ BME280_DIG_H1_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H1_REG = 0xA1
static

◆ BME280_DIG_H2_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H2_LSB_REG = 0xE1
static

◆ BME280_DIG_H2_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H2_MSB_REG = 0xE2
static

◆ BME280_DIG_H3_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H3_REG = 0xE3
static

◆ BME280_DIG_H4_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H4_LSB_REG = 0xE5
static

◆ BME280_DIG_H4_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H4_MSB_REG = 0xE4
static

◆ BME280_DIG_H5_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H5_MSB_REG = 0xE6
static

◆ BME280_DIG_H6_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_H6_REG = 0xE7
static

◆ BME280_DIG_P1_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P1_LSB_REG = 0x8E
static

◆ BME280_DIG_P1_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P1_MSB_REG = 0x8F
static

◆ BME280_DIG_P2_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P2_LSB_REG = 0x90
static

◆ BME280_DIG_P2_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P2_MSB_REG = 0x91
static

◆ BME280_DIG_P3_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P3_LSB_REG = 0x92
static

◆ BME280_DIG_P3_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P3_MSB_REG = 0x93
static

◆ BME280_DIG_P4_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P4_LSB_REG = 0x94
static

◆ BME280_DIG_P4_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P4_MSB_REG = 0x95
static

◆ BME280_DIG_P5_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P5_LSB_REG = 0x96
static

◆ BME280_DIG_P5_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P5_MSB_REG = 0x97
static

◆ BME280_DIG_P6_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P6_LSB_REG = 0x98
static

◆ BME280_DIG_P6_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P6_MSB_REG = 0x99
static

◆ BME280_DIG_P7_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P7_LSB_REG = 0x9A
static

◆ BME280_DIG_P7_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P7_MSB_REG = 0x9B
static

◆ BME280_DIG_P8_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P8_LSB_REG = 0x9C
static

◆ BME280_DIG_P8_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P8_MSB_REG = 0x9D
static

◆ BME280_DIG_P9_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P9_LSB_REG = 0x9E
static

◆ BME280_DIG_P9_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_P9_MSB_REG = 0x9F
static

◆ BME280_DIG_T1_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T1_LSB_REG = 0x88
static

◆ BME280_DIG_T1_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T1_MSB_REG = 0x89
static

◆ BME280_DIG_T2_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T2_LSB_REG = 0x8A
static

◆ BME280_DIG_T2_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T2_MSB_REG = 0x8B
static

◆ BME280_DIG_T3_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T3_LSB_REG = 0x8C
static

◆ BME280_DIG_T3_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_DIG_T3_MSB_REG = 0x8D
static

◆ BME280_HUMIDITY_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_HUMIDITY_LSB_REG = 0xFE
static

◆ BME280_HUMIDITY_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_HUMIDITY_MSB_REG = 0xFD
static

◆ BME280_PRESSURE_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_PRESSURE_LSB_REG = 0xF8
static

◆ BME280_PRESSURE_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_PRESSURE_MSB_REG = 0xF7
static

◆ BME280_PRESSURE_XLSB_REG

int qwiic_bme280.QwiicBme280.BME280_PRESSURE_XLSB_REG = 0xF9
static

◆ BME280_RST_REG

int qwiic_bme280.QwiicBme280.BME280_RST_REG = 0xE0
static

◆ BME280_STAT_REG

int qwiic_bme280.QwiicBme280.BME280_STAT_REG = 0xF3
static

◆ BME280_TEMPERATURE_LSB_REG

int qwiic_bme280.QwiicBme280.BME280_TEMPERATURE_LSB_REG = 0xFB
static

◆ BME280_TEMPERATURE_MSB_REG

int qwiic_bme280.QwiicBme280.BME280_TEMPERATURE_MSB_REG = 0xFA
static

◆ BME280_TEMPERATURE_XLSB_REG

int qwiic_bme280.QwiicBme280.BME280_TEMPERATURE_XLSB_REG = 0xFC
static

◆ calibration

qwiic_bme280.QwiicBme280.calibration

◆ device_name

qwiic_bme280.QwiicBme280.device_name = _DEFAULT_NAME
static

◆ MODE_FORCED

int qwiic_bme280.QwiicBme280.MODE_FORCED = 0b01
static

◆ MODE_NORMAL

int qwiic_bme280.QwiicBme280.MODE_NORMAL = 0b11
static

◆ MODE_SLEEP

int qwiic_bme280.QwiicBme280.MODE_SLEEP = 0b00
static

◆ t_fine

qwiic_bme280.QwiicBme280.t_fine

Property Documentation

◆ altitude_feet

qwiic_bme280.QwiicBme280.altitude_feet = property(get_altitude_feet)
static

◆ altitude_meters

qwiic_bme280.QwiicBme280.altitude_meters = property(get_altitude_meters)
static

◆ connected

qwiic_bme280.QwiicBme280.connected = property(is_connected)
static

◆ dewpoint_celsius

qwiic_bme280.QwiicBme280.dewpoint_celsius = property(get_dewpoint_celsius)
static

◆ dewpoint_fahrenheit

qwiic_bme280.QwiicBme280.dewpoint_fahrenheit = property(get_dewpoint_fahrenheit)
static

◆ filter

qwiic_bme280.QwiicBme280.filter = property()
static

◆ humidity

qwiic_bme280.QwiicBme280.humidity = property(read_humidity)
static

◆ humidity_oversample

qwiic_bme280.QwiicBme280.humidity_oversample = property()
static

◆ mode

qwiic_bme280.QwiicBme280.mode = property(get_mode, set_mode)
static

◆ pressure

qwiic_bme280.QwiicBme280.pressure = property(read_pressure)
static

◆ pressure_oversample

qwiic_bme280.QwiicBme280.pressure_oversample = property()
static

◆ reference_pressure

qwiic_bme280.QwiicBme280.reference_pressure = property(get_reference_pressure, set_reference_pressure)
static

◆ standby_time

qwiic_bme280.QwiicBme280.standby_time = property()
static

◆ tempature_oversample

qwiic_bme280.QwiicBme280.tempature_oversample = property()
static

◆ temperature_celsius

qwiic_bme280.QwiicBme280.temperature_celsius = property(get_temperature_celsius)
static

◆ temperature_fahrenheit

qwiic_bme280.QwiicBme280.temperature_fahrenheit = property(get_temperature_fahrenheit)
static

The documentation for this class was generated from the following file: