Skip to content

Commit 147d0db

Browse files
committed
improving_docs
1 parent 4b8be0e commit 147d0db

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

adafruit_dht.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.
1010
1111
* Author(s): Mike McWethy
12+
13+
**Hardware:**
14+
15+
* Adafruit `DHT22 temperature-humidity sensor + extras
16+
<https://www.adafruit.com/product/385>`_ (Product ID: 385)
17+
18+
* Adafruit `DHT11 basic temperature-humidity sensor + extras
19+
<https://www.adafruit.com/product/386>`_ (Product ID: 386)
20+
21+
22+
**Software and Dependencies:**
23+
24+
* Adafruit CircuitPython firmware for the supported boards:
25+
https://circuitpython.org/downloads
26+
1227
"""
1328

1429
import array
@@ -92,7 +107,7 @@ def _pulses_to_binary(self, pulses, start, stop):
92107
return binary
93108

94109
def _get_pulses_pulseio(self):
95-
"""_get_pulses implements the communication protcol for
110+
"""_get_pulses implements the communication protocol for
96111
DHT11 and DHT22 type devices. It sends a start signal
97112
of a specific length and listens and measures the
98113
return signal lengths.
@@ -169,7 +184,7 @@ def measure(self):
169184
if successful, the class properties temperature and humidity will
170185
return the reading returned from the device.
171186
172-
Raises RuntimeError exception for checksum failure and for insuffcient
187+
Raises RuntimeError exception for checksum failure and for insufficient
173188
data returned from the device (try again)
174189
"""
175190
delay_between_readings = 2 # 2 seconds per read according to datasheet
@@ -238,7 +253,7 @@ def measure(self):
238253
def temperature(self):
239254
"""temperature current reading. It makes sure a reading is available
240255
241-
Raises RuntimeError exception for checksum failure and for insuffcient
256+
Raises RuntimeError exception for checksum failure and for insufficient
242257
data returned from the device (try again)
243258
"""
244259
self.measure()
@@ -248,7 +263,7 @@ def temperature(self):
248263
def humidity(self):
249264
"""humidity current reading. It makes sure a reading is available
250265
251-
Raises RuntimeError exception for checksum failure and for insuffcient
266+
Raises RuntimeError exception for checksum failure and for insufficient
252267
data returned from the device (try again)
253268
"""
254269
self.measure()

docs/examples.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ Ensure your device works with this simple test.
88
:linenos:
99

1010

11+
DHT to Led Display
12+
------------------
13+
14+
Example of reading temperature and humidity from a DHT device
15+
and displaying results to the serial port and a 8 digit 7-segment display
16+
17+
.. literalinclude:: ../examples/dht_to_led_display.py
18+
:caption: examples/dht_to_led_display.py
19+
:linenos:
20+
21+
1122
Time calibration advance test
1223
------------------------------
1324

14-
Check what is the best time your sensor.
25+
Example to identify best waiting time for the sensor
1526

1627
.. literalinclude:: ../examples/dht_time_calibration_advance.py
1728
:caption: examples/dht_time_calibration_advance.py

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26+
DHT basic temperature-humidity sensor Learning Guide <https://learn.adafruit.com/dht>
27+
2628
.. toctree::
2729
:caption: Related Products
2830

0 commit comments

Comments
 (0)