Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pi@raspberrypi:~ $ cat Temp.py
- import Adafruit_DHT
- import time
- DHT_SENSOR = Adafruit_DHT.DHT11
- DHT_PIN = 4
- humidity, temperature = Adafruit_DHT.read(DHT_SENSOR, DHT_PIN)
- if humidity is not None and temperature is not None:
- print("{0:0.1f},{1:0.1f}".format(temperature,humidity))
- else:
- print("-1,-1");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement