Skip to content
Snippets Groups Projects
Commit fce15ef0 authored by LANGLAIS Charlotte's avatar LANGLAIS Charlotte
Browse files

Upload New File

parent 29e9bbfe
Branches
No related tags found
No related merge requests found
import time
import pycom
import ubinascii
from machine import enable_irq, disable_irq, Pin
from dht import DTH
#Mettre votre n° de broche
th = DTH('P9')
pycom.heartbeat(False)
while True:
result = th.read()
while not result.is_valid():
time.sleep(.5)
result = th.read()
print('Temp:', result.temperature)
print('RH:', result.humidity)
if result.temperature > 25:
pycom.rgbled(0xff0000)
else:
pycom.rgbled(0x00ff00)
#5 secondes entre 2 lectures avec retour au bleu
time.sleep(2.5)
pycom.rgbled(0x0000ff)
time.sleep(2.5)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment