adafruit_dps310
¶
Library for the DPS310 Precision Barometric Pressure Sensor
- Author(s): Bryan Siepert
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.
DPS310
(i2c_bus, address=119)¶ Library for the DPS310 Precision Barometric Pressure Sensor.
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 import adafruit_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 = adafruit_dps310.DPS310(i2c)
Now you have access to the
temperature
andpressure
attributes.temperature = dps310.temperature pressure = dps310.pressure
-
altitude
¶ The altitude based on the sea level pressure (
sea_level_pressure
) - which you must enter ahead of time)
-
initialize
()¶ Initialize the sensor to continuous measurement
-
pressure
¶ Returns the current pressure reading in hPA
-
pressure_oversample_count
¶ The number of samples taken per pressure measurement. Must be a
SampleCount
-
pressure_ready
¶ Returns true if pressure readings are ready
-
reset
()¶ Reset the sensor
-
temperature
¶ The current temperature reading in degrees Celsius
-
temperature_oversample_count
¶ The number of samples taken per temperature measurement. Must be a
SampleCount
-
temperature_ready
¶ Returns true if there is a temperature reading ready
-
-
class
adafruit_dps310.
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.
Rate
¶ Options for
pressure_rate
andtemperature_rate