Skip to content

Commit 419dd74

Browse files
committed
updating docs
1 parent e6cdd23 commit 419dd74

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ Usage Example
6262
import adafruit_lps2x
6363
6464
i2c = busio.I2C(board.SCL, board.SDA)
65-
lps = adafruit_lps2x.LPS25HW(i2c)
66-
print("out of reset/init")
65+
# uncomment and comment out the line after to use with the LPS22
66+
# lps = adafruit_lps2x.LPS22(i2c)
67+
lps = adafruit_lps2x.LPS25(i2c)
6768
while True:
6869
print("Pressure: %.2f hPa" % lps.pressure)
69-
print("Temperature: %.2f C"% lps.temperature)
70+
print("Temperature: %.2f C" % lps.temperature)
7071
time.sleep(1)
7172
7273
Contributing

adafruit_lps2x.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
3434
**Hardware:**
3535
36-
* `LPS25HB Breakout <https://www.adafruit.com/products/45XX>`_
36+
* LPS25HB Breakout https://www.adafruit.com/products/4530
3737
3838
**Software and Dependencies:**
3939
* Adafruit CircuitPython firmware for the supported boards:
@@ -105,20 +105,31 @@ def is_valid(cls, value):
105105
class Rate(CV):
106106
"""Options for ``data_rate``
107107
108-
+-----------------------+------------------------------------------------------------------+
109-
| Rate | Description |
110-
+-----------------------+------------------------------------------------------------------+
111-
| ``Rate.ONE_SHOT`` | Setting `data_rate` to ``Rate.ONE_SHOT`` takes a single pressure |
112-
| | and temperature measurement |
113-
+-----------------------+------------------------------------------------------------------+
114-
| ``Rate.RATE_1_HZ`` | 1 Hz |
115-
+-----------------------+------------------------------------------------------------------+
116-
| ``Rate.RATE_7_HZ`` | 7 Hz |
117-
+-----------------------+------------------------------------------------------------------+
118-
| ``Rate.RATE_12_5_HZ`` | 12.5 Hz |
119-
+-----------------------+------------------------------------------------------------------+
120-
| ``Rate.RATE_25_HZ`` | 25 Hz |
121-
+-----------------------+------------------------------------------------------------------+
108+
+-----------------------------+------------------------------------------------+
109+
| Rate | Description |
110+
+-----------------------------+------------------------------------------------+
111+
| ``Rate.LSP25_SHUTDOWN`` | Setting `data_rate` to ``Rate.LSP25_SHUTDOWN`` |
112+
| | stops measurements from being taken |
113+
+-----------------------------+------------------------------------------------+
114+
| ``Rate.LSP25_RATE_1_HZ`` | 1 Hz |
115+
+-----------------------------+------------------------------------------------+
116+
| ``Rate.LSP25_RATE_7_HZ`` | 7 Hz |
117+
+-----------------------------+------------------------------------------------+
118+
| ``Rate.LSP25_RATE_12_5_HZ`` | 12.5 Hz |
119+
+-----------------------------+------------------------------------------------+
120+
| ``Rate.LSP25_RATE_25_HZ`` | 25 Hz |
121+
+-----------------------------+------------------------------------------------+
122+
| ``Rate.LSP22_SHUTDOWN`` | Setting `data_rate` to ``Rate.LSP22_SHUTDOWN`` |
123+
| | stops measurements from being taken |
124+
+-----------------------------+------------------------------------------------+
125+
| ``Rate.LSP22_RATE_1_HZ`` | 1 Hz |
126+
+-----------------------------+------------------------------------------------+
127+
| ``Rate.LSP22_RATE_10_HZ`` | 10 Hz |
128+
+-----------------------------+------------------------------------------------+
129+
| ``Rate.LSP22_RATE_25_HZ`` | 25 Hz |
130+
+-----------------------------+------------------------------------------------+
131+
| ``Rate.LSP22_RATE_50_HZ`` | 50 Hz |
132+
+-----------------------------+------------------------------------------------+
122133
123134
"""
124135

@@ -182,10 +193,7 @@ def temperature(self):
182193
@property
183194
def data_rate(self):
184195
"""The rate at which the sensor measures ``pressure`` and ``temperature``. ``data_rate``
185-
shouldbe set to one of the values of ``adafruit_lps2x.DataRate``. Note that setting
186-
``data_rate``to ``Rate.ONE_SHOT`` places the sensor into a low-power shutdown mode where
187-
measurements toupdate ``pressure`` and ``temperature`` are only taken when
188-
``take_measurement`` is called."""
196+
shouldbe set to one of the values of ``adafruit_lps2x.Rate``."""
189197
return self._data_rate
190198

191199
@data_rate.setter
@@ -195,9 +203,6 @@ def data_rate(self, value):
195203

196204
self._data_rate = value
197205

198-
# void setPresThreshold(uint16_t hPa_delta);
199-
# bool getEvent(sensors_event_t *pressure, sensors_event_t *temp);
200-
201206

202207
class LPS25(LPS2X):
203208
"""Library for the ST LPS25 pressure sensors

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Table of Contents
2727
.. toctree::
2828
:caption: Related Products
2929

30-
* `LPS25HW Breakout <https://www.adafruit.com/products/4258>`_
30+
* LPS25HW Breakout <https://www.adafruit.com/products/4258>
3131

3232
.. toctree::
3333
:caption: Other Links

0 commit comments

Comments
 (0)