Skip to content

Instantly share code, notes, and snippets.

@kloneets
Created February 18, 2016 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kloneets/d5b01312eedfa4d10c31 to your computer and use it in GitHub Desktop.
Save kloneets/d5b01312eedfa4d10c31 to your computer and use it in GitHub Desktop.
Get remperature from DGT11
import Adafruit_DHT
while True:
try:
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 4)
print "Temperature: " + str(temperature)
except (KeyboardInterrupt, SystemExit):
print "\nInterrupted by user"
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment