Skip to content

Instantly share code, notes, and snippets.

@nkenna
Created October 29, 2019 11:55
Show Gist options
  • Save nkenna/048b38a606beb3fc10f1d069fa7addff to your computer and use it in GitHub Desktop.
Save nkenna/048b38a606beb3fc10f1d069fa7addff to your computer and use it in GitHub Desktop.
def getTemp():
global temperature
global humidity
global tt
hum, tempe = Adafruit_DHT.read_retry(sensormodel, sensorpin)
humidity = hum
humidity = float("{:0.2f}".format(humidity))
temperature = tempe
tt = tempe
temperature = float("{:0.2f}".format(temperature))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment