Skip to content

improving_docs #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions adafruit_dht.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.

* Author(s): Mike McWethy

**Hardware:**

* Adafruit `DHT22 temperature-humidity sensor + extras
<https://www.adafruit.com/product/385>`_ (Product ID: 385)

* Adafruit `DHT11 basic temperature-humidity sensor + extras
<https://www.adafruit.com/product/386>`_ (Product ID: 386)


**Software and Dependencies:**

* Adafruit CircuitPython firmware for the supported boards:
https://circuitpython.org/downloads

"""

import array
Expand Down Expand Up @@ -92,7 +107,7 @@ def _pulses_to_binary(self, pulses, start, stop):
return binary

def _get_pulses_pulseio(self):
"""_get_pulses implements the communication protcol for
"""_get_pulses implements the communication protocol for
DHT11 and DHT22 type devices. It sends a start signal
of a specific length and listens and measures the
return signal lengths.
Expand Down Expand Up @@ -169,7 +184,7 @@ def measure(self):
if successful, the class properties temperature and humidity will
return the reading returned from the device.

Raises RuntimeError exception for checksum failure and for insuffcient
Raises RuntimeError exception for checksum failure and for insufficient
data returned from the device (try again)
"""
delay_between_readings = 2 # 2 seconds per read according to datasheet
Expand Down Expand Up @@ -238,7 +253,7 @@ def measure(self):
def temperature(self):
"""temperature current reading. It makes sure a reading is available

Raises RuntimeError exception for checksum failure and for insuffcient
Raises RuntimeError exception for checksum failure and for insufficient
data returned from the device (try again)
"""
self.measure()
Expand All @@ -248,7 +263,7 @@ def temperature(self):
def humidity(self):
"""humidity current reading. It makes sure a reading is available

Raises RuntimeError exception for checksum failure and for insuffcient
Raises RuntimeError exception for checksum failure and for insufficient
data returned from the device (try again)
"""
self.measure()
Expand Down
13 changes: 12 additions & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ Ensure your device works with this simple test.
:linenos:


DHT to Led Display
------------------

Example of reading temperature and humidity from a DHT device
and displaying results to the serial port and a 8 digit 7-segment display

.. literalinclude:: ../examples/dht_to_led_display.py
:caption: examples/dht_to_led_display.py
:linenos:


Time calibration advance test
------------------------------

Check what is the best time your sensor.
Example to identify best waiting time for the sensor

.. literalinclude:: ../examples/dht_time_calibration_advance.py
:caption: examples/dht_time_calibration_advance.py
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Table of Contents
.. toctree::
:caption: Tutorials

DHT basic temperature-humidity sensor Learning Guide <https://learn.adafruit.com/dht>

.. toctree::
:caption: Related Products

Expand Down