import machine
from machine import Pin
LedRojo = Pin(14,Pin.OUT)
LedAmarillo = Pin(27,Pin.OUT)
LedAzul = Pin(26,Pin.OUT)
LedVerde = Pin(25,Pin.OUT)
Entrada1 = Pin(23,Pin.IN,Pin.PULL_UP)
Entrada2 = Pin(2,Pin.IN,Pin.PULL_UP)
Entrada3 = Pin(5,Pin.IN,Pin.PULL_UP)
while True:
A=Entrada1.value()
s0=Entrada2.value()
s1=Entrada3.value()
rojo = (not s0 and not s1) and A
amarillo = (s0 and not s1) and A
azul = (not s0 and s1) and A
verde = (s0 and s1) and A
LedAmarillo.value(amarillo)
LedAzul.value(azul)
LedRojo.value(rojo)
LedVerde.value(verde)