Skip to content

Commit 3d960a7

Browse files
committed
2 parents dc2a7f6 + be6957c commit 3d960a7

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

python/Raspberry-Pi-Gas-Sensor-MQ

Lines changed: 0 additions & 1 deletion
This file was deleted.

python/dth11.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

python/dth11/current.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#! /usr/bin/python
2+
# -*- coding: UTF-8 -*-
3+
4+
import Adafruit_DHT
5+
6+
sensor = Adafruit_DHT.DHT11
7+
8+
pin=23
9+
10+
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
11+
if humidity is not None and temperature is not None:
12+
print({'success':True,'data':{'temp':'%.1f'%temperature,'humidity':'%d'%humidity}})
13+
else:
14+
print({'success':False,'data':'读取失败,请尝试重试'})

python/hello

-7.95 KB
Binary file not shown.

python/hello-world.c

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)