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
DPS310class. 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.I2Cobject and define your sensor objecti2c = board.I2C() # uses board.SCL and board.SDA dps310 = adafruit_dps310.DPS310(i2c)
Now you have access to the
temperatureandpressureattributes.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
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.Rate¶ Options for
pressure_rateandtemperature_rate