Created
February 21, 2018 09:13
-
-
Save elktros/f9f1c9e8475956d43eba95e8681676c7 to your computer and use it in GitHub Desktop.
Python Script for Interfacing DHT11 Humidity and Temperature Sensor with Raspberry Pi.
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
import sys | |
import Adafruit_DHT | |
import time | |
while True: | |
humidity, temperature = Adafruit_DHT.read_retry(11, 4) | |
print 'Temp: {0:0.1f} C Humidity: {1:0.1f} %'.format(temperature, humidity) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment