D4ncs0

lcdtemp.py

Dec 26th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import Adafruit_DHT as dht
  2. import lcddriver
  3. lcd = lcddriver.lcd()
  4. try:
  5. while True:
  6. h,t = dht.read_retry(dht.DHT22, 4)
  7. lcd.lcd_display_string("Homerseklet: {0:0.1f}*C".format(t, h), 1)
  8. lcd.lcd_display_string("Paratartalom: {1:0.1f}%".format(t, h), 2)
  9. time.sleep(60)
  10. except KeyboardInterrupt:
  11. lcd.lcd_clear()
Advertisement
Add Comment
Please, Sign In to add comment