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
DPS310
class. 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.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA dps310 = DPS310(i2c)
Now you have access to the
temperature
andpressure
attributes.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_Advanced
class. 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.I2C
object and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA dps310 = DPS310(i2c)
Now you have access to the
temperature
andpressure
attributes.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_PRESSURE
orMode.CONT_PRESTEMP
See theMode
documentation 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_TEMP
orMode.CONT_PRESTEMP
. See theMode
documentation for details.
- class adafruit_dps310.advanced.Mode¶
Options for
mode
Mode
Description
Mode.IDLE
Puts the sensor into a shutdown state
Mode.ONE_PRESSURE
Setting
mode
toMode.ONE_PRESSURE
takes a single pressure measurement then switches toMode.IDLE
Mode.ONE_TEMPERATURE
Setting
mode
toMode.ONE_TEMPERATURE
takes a single temperature measurement then switches toMode.IDLE
Mode.CONT_PRESSURE
Take pressure measurements at the current
pressure_rate
.temperature
will not be updatedMode.CONT_TEMP
Take temperature measurements at the current
temperature_rate
.pressure
will not be updatedMode.CONT_PRESTEMP
Take temperature and pressure measurements at the current
pressure_rate
andtemperature_rate
- class adafruit_dps310.advanced.Rate¶
Options for
pressure_rate
andtemperature_rate