#Ejercicio 6: Sistema de parada de emergencia con múltiples zonas
#Nombre: Zhayanka Pilay Beltrán
from machine import Pin
import time
ledA = Pin(10, Pin.OUT)
ledB = Pin(5, Pin.OUT)
botone= Pin(20, Pin.IN, Pin.PULL_DOWN)
botonr = Pin(28, Pin.IN, Pin.PULL_DOWN)
bloquear= False
while True:
if not bloquear:
ledA.value(1)
ledB.value(1)
time.sleep(1)
if botone.value() ==1:
ledA.value(0)
ledB.value(0)
bloquear= True
print("Sistema bloqueado por 5 segundoos")
time.sleep(5)
else:
print("Presiona el botón de reinicio para continuar")
while botonr.value()==0:
pass
print("Sistema reiniciando")
bloquear = False
time.sleep(0.5)
Emergencia
Reinicio