Created
November 10, 2016 08:45
-
-
Save guillemborrell/460aba462267bcc9bf0a03f330af8efd to your computer and use it in GitHub Desktop.
Still playing with micropython and the DHT11
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 dht | |
import machine | |
from machine import Timer | |
d = dht.DHT11(machine.Pin(4)) | |
def display_dht11(t): | |
d.measure() | |
print('Temperature:', d.temperature(), 'Humidity:', d.humidity()) | |
tim = Timer(-1) | |
tim.init(period=5000, mode=Timer.PERIODIC, callback=display_dht11) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment