Created
April 5, 2022 22:40
-
-
Save securetorobert/4f8d663bb17806c92028e55ed498f5eb to your computer and use it in GitHub Desktop.
Revisions
-
securetorobert created this gist
Apr 5, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ # # Weather Station. Requires Grove Shield, Temp Sensor, and LCD import utime from lcd1602 import LCD1602 from dht11 import * from machine import Pin, I2C from time import sleep dht2 = DHT(18) #temperature and humidity sensor connect to D18 port i2c = I2C(1, scl=Pin(7), sda=Pin(6), freq=400000) d = LCD1602(i2c, 2, 16) while True: t,h = dht2.readTempHumid()#temp: humid: d.clear() d.print('T: {} C'.format(t)) d.setCursor(0,1) d.print('H: {} %'.format(h)) print('T: {}'.format(t)) print('H: {}'.format(h)) utime.sleep(5)