Skip to content

Instantly share code, notes, and snippets.

@joelthchao
Created March 18, 2018 11:05
Show Gist options
  • Save joelthchao/7cae36362b924685d4b23a12a8a0d7cb to your computer and use it in GitHub Desktop.
Save joelthchao/7cae36362b924685d4b23a12a8a0d7cb to your computer and use it in GitHub Desktop.
DHT
import Adafruit_DHT
sensor = Adafruit_DHT.AM2302
pin = 4
humidity, temperature = Adafruit_DHT.read_retry(
sensor, pin, retries=5, delay_seconds=1)
print('{},{}'.format(humidity, temperature))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment