Created
May 12, 2019 08:40
-
-
Save bjoernhohe/691b35030bcc0c0b8f292828941438fa to your computer and use it in GitHub Desktop.
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 time | |
import Adafruit_DHT | |
from RPLCD.i2c import CharLCD | |
sensor = Adafruit_DHT.DHT11 | |
pin = 4 | |
lcd = CharLCD('PCF8574', 0x27) | |
while True: | |
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) | |
lcd.cursor_pos = (0, 0) | |
lcd.write_string("Temp: %d C" % temperature) | |
lcd.cursor_pos = (1, 0) | |
lcd.write_string("Humidity: %d %%" % humidity) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment