from machine import Pin
import time
pin_pir = Pin(12, Pin.IN)
pin_pir = Pin(13, Pin.OUT)
Wile trye:
if pin_pir.value() == 1:
print"(Movimiento detectado")
pin_rele.value(1)
time.Sleep(5)
pin_rele.value(0)
time.sleep(0.1)
from machine import Pin
import time
pin_pir = Pin(12, Pin.IN)
pin_pir = Pin(13, Pin.OUT)
Wile trye:
if pin_pir.value() == 1:
print"(Movimiento detectado")
pin_rele.value(1)
time.Sleep(5)
pin_rele.value(0)
time.sleep(0.1)