forked from mrmcwethy/Adafruit_CircuitPython_DHT
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from sommersoft/new_docs
Improve Ref Docs
- Loading branch information
Showing
11 changed files
with
151 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
python: | ||
version: 3 | ||
requirements_file: requirements.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
.. If you created a package, create one automodule per module in the package. | ||
.. automodule:: adafruit_dht | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Simple test | ||
------------ | ||
|
||
Ensure your device works with this simple test. | ||
|
||
.. literalinclude:: ../examples/dht_simpletest.py | ||
:caption: examples/dht_simpletest.py | ||
:linenos: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. include:: ../README.rst | ||
|
||
Table of Contents | ||
================= | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
:hidden: | ||
|
||
self | ||
|
||
.. toctree:: | ||
:caption: Examples | ||
|
||
examples | ||
|
||
.. toctree:: | ||
:caption: API Reference | ||
:maxdepth: 3 | ||
|
||
api | ||
|
||
.. toctree:: | ||
:caption: Tutorials | ||
|
||
.. toctree:: | ||
:caption: Related Products | ||
|
||
DHT11 basic temperature-humidity sensor + extras <https://www.adafruit.com/product/386> | ||
|
||
DHT22 basic temperature-humidity sensor + extras <https://www.adafruit.com/product/385> | ||
|
||
.. toctree:: | ||
:caption: Other Links | ||
|
||
Download <https://github.com/adafruit/Adafruit_CircuitPython_DHT/releases/latest> | ||
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io> | ||
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60> | ||
Discord Chat <https://adafru.it/discord> | ||
Adafruit Learning System <https://learn.adafruit.com> | ||
Adafruit Blog <https://blog.adafruit.com> | ||
Adafruit Store <https://www.adafruit.com> | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import time | ||
import adafruit_dht | ||
from board import D2 | ||
|
||
#initial the dht device | ||
dhtDevice = adafruit_dht.DHT22(D2) | ||
|
||
while True: | ||
try: | ||
# show the values to the serial port | ||
temperature = dhtDevice.temperature * (9 / 5) + 32 | ||
humidity = dhtDevice.humidity | ||
print("Temp: {:.1f} F Humidity: {}% ".format(temperature, humidity)) | ||
|
||
except RuntimeError as error: | ||
print(error.args) | ||
|
||
time.sleep(2.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters