API Reference
adafruit_dps310
Library for the DPS310 Precision Barometric Pressure Sensor
Author(s): Bryan Siepert, Jose David M.
adafruit_dps310.basic
Library for the DPS310 Precision Barometric Pressure Sensor
Author(s): Bryan Siepert, Jose David M.
Implementation Notes
Hardware:
Adafruit DPS310 Precision Barometric Pressure / Altitude Sensor (Product ID: 4494)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class adafruit_dps310.basic.DPS310(i2c_bus: I2C, address: int = micropython.const)
Library for the DPS310 Precision Barometric Pressure Sensor. Depending on your board memory availability you could use DPS310_Advanced.
- Parameters:
Quickstart: Importing and using the DPS310
Here is an example of using the
DPS310class. First you will need to import the libraries to use the sensorimport board from adafruit_dps310.basic import DPS310
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA dps310 = DPS310(i2c)
Now you have access to the
temperatureandpressureattributes.temperature = dps310.temperature pressure = dps310.pressure
- property altitude: float
The altitude in meters based on the sea level pressure (
sea_level_pressure) - which you must enter ahead of time
adafruit_dps310.advanced
Library for the DPS310 Precision Barometric Pressure Sensor. This is the advanced
version. Includes some features not present in adafruit_dps310.basic
Author(s): Bryan Siepert, Jose David M.
Implementation Notes
Hardware:
Adafruit DPS310 Precision Barometric Pressure / Altitude Sensor (Product ID: 4494)
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
Adafruit’s Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
- class adafruit_dps310.advanced.DPS310_Advanced(i2c_bus: I2C, address: int = micropython.const)
Library for the DPS310 Precision Barometric Pressure Sensor. This class contains some of other configurable features
- Parameters:
Quickstart: Importing and using the DPS310
Here is an example of using the
DPS310_Advancedclass. First you will need to import the libraries to use the sensorimport board from adafruit_dps310.dps310_advanced import DPS310_Advanced as DPS310
Once this is done you can define your
board.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA dps310 = DPS310(i2c)
Now you have access to the
temperatureandpressureattributes.temperature = dps310.temperature pressure = dps310.pressure
- property pressure_oversample_count: int
The number of samples taken per pressure measurement. Must be a
SampleCount
- property temperature_oversample_count: int
The number of samples taken per temperature measurement. Must be a
SampleCount
- wait_pressure_ready() None
Wait until a pressure measurement is available
To avoid waiting indefinitely this function raises an error if the sensor isn’t configured for pressure measurements, ie.
Mode.ONE_PRESSURE,Mode.CONT_PRESSUREorMode.CONT_PRESTEMPSee theModedocumentation for details.
- wait_temperature_ready() None
Wait until a temperature measurement is available.
To avoid waiting indefinitely this function raises an error if the sensor isn’t configured for temperate measurements, ie.
Mode.ONE_TEMPERATURE,Mode.CONT_TEMPorMode.CONT_PRESTEMP. See theModedocumentation for details.
- class adafruit_dps310.advanced.Mode
Options for
modeMode
Description
Mode.IDLEPuts the sensor into a shutdown state
Mode.ONE_PRESSURESetting
modetoMode.ONE_PRESSUREtakes a single pressure measurement then switches toMode.IDLEMode.ONE_TEMPERATURESetting
modetoMode.ONE_TEMPERATUREtakes a single temperature measurement then switches toMode.IDLEMode.CONT_PRESSURETake pressure measurements at the current
pressure_rate.temperaturewill not be updatedMode.CONT_TEMPTake temperature measurements at the current
temperature_rate.pressurewill not be updatedMode.CONT_PRESTEMPTake temperature and pressure measurements at the current
pressure_rateandtemperature_rate
- class adafruit_dps310.advanced.Rate
Options for
pressure_rateandtemperature_rate