We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83aaced commit a8e2023Copy full SHA for a8e2023
source/DHT22.py
@@ -1,12 +1,14 @@
1
# -*- coding: utf-8 -*
2
from time import sleep
3
-from dhtxx import DHT22
+#from dhtxx import DHT22
4
+from dhtxx import DHT11
5
-dht = DHT22(4)
6
+#dht = DHT22(22)
7
+dht = DHT11(22)
8
while True:
9
try:
10
res = dht.get_result_once()
- print('Temp: ' + '{:.2f}'.format(res[0]) + '°C, Hum: ' + '{:.2f}'.format(res[1]))
11
+ print('Temp: ' + '{:.1f}'.format(res[0]) + '°C, Hum: ' + '{:.1f}'.format(res[1]))
12
except Exception as e:
13
print(e)
14
sleep(1)
0 commit comments