2
2
Introduction
3
3
============
4
4
5
- .. image :: https://readthedocs.org/projects/adafruit-circuitpython-dhtlib /badge/?version=latest
6
- :target: https://circuitpython.readthedocs.io/projects/dhtlib /en/latest/
5
+ .. image :: https://readthedocs.org/projects/adafruit-circuitpython-dht /badge/?version=latest
6
+ :target: https://circuitpython.readthedocs.io/projects/dht /en/latest/
7
7
:alt: Documentation Status
8
8
9
9
.. image :: https://badges.gitter.im/adafruit/circuitpython.svg
@@ -39,7 +39,7 @@ Of course, you must import the library to use it:
39
39
40
40
.. code :: python
41
41
42
- import adafruit_dhtlib
42
+ import adafruit_dht
43
43
44
44
The DHT type devices use single data wire, so import the board pin
45
45
@@ -51,13 +51,13 @@ Now, to initialize the DHT11 device:
51
51
52
52
.. code :: python
53
53
54
- dhtDevice = dht .DHT11(< pin> )
54
+ dht_device = adafruit_dht .DHT11(< pin> )
55
55
56
56
OR initialize the DHT22 device:
57
57
58
58
.. code :: python
59
59
60
- dhtDevice = dht .DHT22(< pin> )
60
+ dht_device = adafruit_dht .DHT22(< pin> )
61
61
62
62
Read temperature and humidity
63
63
----------------------------
@@ -66,8 +66,8 @@ Now get the temperature and humidity values
66
66
67
67
.. code :: python
68
68
69
- temperature = dhtDevice .temperature
70
- humidity = dhtDevice .humidity
69
+ temperature = dht_device .temperature
70
+ humidity = dht_device .humidity
71
71
72
72
These properties may raise an exception if a problem occurs. You should use try/raise
73
73
logic and catch RuntimeError and then retry getting the values after 1/2 second.
@@ -76,7 +76,7 @@ Contributing
76
76
============
77
77
78
78
Contributions are welcome! Please read our `Code of Conduct
79
- <https://github.com/adafruit/Adafruit_CircuitPython_dhtlib /blob/master/CODE_OF_CONDUCT.md> `_
79
+ <https://github.com/adafruit/Adafruit_CircuitPython_DHT /blob/master/CODE_OF_CONDUCT.md> `_
80
80
before contributing to help this project stay welcoming.
81
81
82
82
API Reference
0 commit comments