From 147d0dbec14acb87c2a3b67b28efe21b2a412d06 Mon Sep 17 00:00:00 2001 From: jposada202020 Date: Sun, 25 Apr 2021 13:00:43 -0400 Subject: [PATCH] improving_docs --- adafruit_dht.py | 23 +++++++++++++++++++---- docs/examples.rst | 13 ++++++++++++- docs/index.rst | 2 ++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/adafruit_dht.py b/adafruit_dht.py index 2e76eb9..d11881b 100644 --- a/adafruit_dht.py +++ b/adafruit_dht.py @@ -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 + `_ (Product ID: 385) + +* Adafruit `DHT11 basic temperature-humidity sensor + extras + `_ (Product ID: 386) + + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the supported boards: + https://circuitpython.org/downloads + """ import array @@ -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. @@ -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 @@ -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() @@ -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() diff --git a/docs/examples.rst b/docs/examples.rst index 399b499..9eaf319 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -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 diff --git a/docs/index.rst b/docs/index.rst index 2c9e99b..76d6e64 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,6 +23,8 @@ Table of Contents .. toctree:: :caption: Tutorials + DHT basic temperature-humidity sensor Learning Guide + .. toctree:: :caption: Related Products