9
9
CircuitPython support for the DHT11 and DHT22 temperature and humidity devices.
10
10
11
11
* 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
+
12
27
"""
13
28
14
29
import array
@@ -92,7 +107,7 @@ def _pulses_to_binary(self, pulses, start, stop):
92
107
return binary
93
108
94
109
def _get_pulses_pulseio (self ):
95
- """_get_pulses implements the communication protcol for
110
+ """_get_pulses implements the communication protocol for
96
111
DHT11 and DHT22 type devices. It sends a start signal
97
112
of a specific length and listens and measures the
98
113
return signal lengths.
@@ -169,7 +184,7 @@ def measure(self):
169
184
if successful, the class properties temperature and humidity will
170
185
return the reading returned from the device.
171
186
172
- Raises RuntimeError exception for checksum failure and for insuffcient
187
+ Raises RuntimeError exception for checksum failure and for insufficient
173
188
data returned from the device (try again)
174
189
"""
175
190
delay_between_readings = 2 # 2 seconds per read according to datasheet
@@ -238,7 +253,7 @@ def measure(self):
238
253
def temperature (self ):
239
254
"""temperature current reading. It makes sure a reading is available
240
255
241
- Raises RuntimeError exception for checksum failure and for insuffcient
256
+ Raises RuntimeError exception for checksum failure and for insufficient
242
257
data returned from the device (try again)
243
258
"""
244
259
self .measure ()
@@ -248,7 +263,7 @@ def temperature(self):
248
263
def humidity (self ):
249
264
"""humidity current reading. It makes sure a reading is available
250
265
251
- Raises RuntimeError exception for checksum failure and for insuffcient
266
+ Raises RuntimeError exception for checksum failure and for insufficient
252
267
data returned from the device (try again)
253
268
"""
254
269
self .measure ()
0 commit comments