Package com.diozero.devices
Class BME680
java.lang.Object
com.diozero.devices.BME680
- All Implemented Interfaces:
DeviceInterface
,BarometerInterface
,HygrometerInterface
,SensorInterface
,ThermometerInterface
,AutoCloseable
public class BME680 extends Object implements BarometerInterface, ThermometerInterface, HygrometerInterface
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BME680.Calibration
static class
BME680.Data
static class
BME680.FilterSize
IIR filter size.static class
BME680.GasSettings
static class
BME680.HeaterProfile
Gas heater profile.static class
BME680.OversamplingMultiplier
Oversampling multiplier.static class
BME680.PowerMode
Power mode.static class
BME680.SensorSettings
-
Field Summary
Fields Modifier and Type Field Description static int
DEVICE_ADDRESS
Default I2C address for the sensor. -
Constructor Summary
-
Method Summary
-
Field Details
-
DEVICE_ADDRESS
public static final int DEVICE_ADDRESSDefault I2C address for the sensor.- See Also:
- Constant Field Values
-
-
Constructor Details
-
BME680
public BME680() -
BME680
public BME680(int controller)Create a new BME680 sensor driver connected on the given bus.- Parameters:
controller
- I2C bus the sensor is connected to.
-
BME680
public BME680(int controller, int address)Create a new BME680 sensor driver connected on the given bus and address.- Parameters:
controller
- I2C bus the sensor is connected to.address
- I2C address of the sensor.
-
-
Method Details
-
getTemperature
public float getTemperature()Description copied from interface:ThermometerInterface
Get temperature in degrees celsius- Specified by:
getTemperature
in interfaceThermometerInterface
- Returns:
- Temperature (deg C)
-
getPressure
public float getPressure()Description copied from interface:BarometerInterface
Get the pressure in kPa- Specified by:
getPressure
in interfaceBarometerInterface
- Returns:
- pressure in kPa
-
getRelativeHumidity
public float getRelativeHumidity()Description copied from interface:HygrometerInterface
Get the relative humidity in percent.- Specified by:
getRelativeHumidity
in interfaceHygrometerInterface
- Returns:
- The relative humidity in percent.
-
getGasResistance
public float getGasResistance() -
getAirQuality
public float getAirQuality() -
close
public void close()Close the driver and the underlying device.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
- Specified by:
close
in interfaceHygrometerInterface
-
setSensorSettings
public void setSensorSettings(BME680.HeaterProfile heaterProfile, int heaterTemperature, int heaterDuration, BME680.FilterSize filterSize) -
getPowerMode
-
setPowerMode
-
getTemperatureOversample
-
setTemperatureOversample
-
getHumidityOversample
-
setHumidityOversample
-
getPressureOversample
-
setPressureOversample
-
getFilter
-
setFilter
-
setGasConfig
-
getGasHeaterProfile
-
isHeaterEnabled
public boolean isHeaterEnabled() -
setHeaterEnabled
public void setHeaterEnabled(boolean heaterEnabled) -
isGasMeasurementEnabled
public boolean isGasMeasurementEnabled() -
setGasMeasurementEnabled
public void setGasMeasurementEnabled(boolean gasMeasurementsEnabled) -
setTemperatureOffset
public void setTemperatureOffset(int value)Set temperature offset in celsius. If set, the temperature t_fine will be increased by given value in celsius.- Parameters:
value
- temperature offset in Celsius, eg. 4, -8, 1.25
-
getSensorData
-