Skip to content

Commit bfd1047

Browse files
authored
Merge pull request #17 from jposada202020/adding_waitingtime_as_option
Adding waiting time as option
2 parents 8fa6f96 + 8babfab commit bfd1047

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

adafruit_bmp3xx.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
1616
**Hardware:**
1717
18-
* `Adafruit BMP388 <https://www.adafruit.com/product/3966>`_
18+
* `Adafruit BMP388 - Precision Barometric Pressure and Altimeter
19+
<https://www.adafruit.com/product/3966>`_ (Product ID: 3966)
1920
2021
**Software and Dependencies:**
2122
2223
* Adafruit CircuitPython firmware for the supported boards:
23-
https://github.com/adafruit/circuitpython/releases
24+
https://circuitpython.org/downloads
25+
26+
* Adafruit's Bus Device library:
27+
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2428
25-
# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2629
"""
2730

2831
import time
@@ -66,6 +69,7 @@ def __init__(self):
6669
self._read_coefficients()
6770
self.reset()
6871
self.sea_level_pressure = 1013.25
72+
self._wait_time = 0.002 # change this value to have faster reads if needed
6973
"""Sea level pressure in hPa."""
7074

7175
@property
@@ -141,7 +145,7 @@ def _read(self):
141145

142146
# Wait for *both* conversions to complete
143147
while self._read_byte(_REGISTER_STATUS) & 0x60 != 0x60:
144-
time.sleep(0.002)
148+
time.sleep(self._wait_time)
145149

146150
# Get ADC values
147151
data = self._read_register(_REGISTER_PRESSUREDATA, 6)

0 commit comments

Comments
 (0)