import machine
from machine import Pin
#Salidas
ledRojo = Pin(1, Pin.OUT)
ledAzul = Pin(2, Pin.OUT)
ledVerde = Pin(3, Pin.OUT)
ledAmarillo = Pin(0, Pin.OUT)
#Entradas
SliderA = Pin(4, Pin.IN,Pin.PULL_UP)
SliderB = Pin(5, Pin.IN,Pin.PULL_UP)
#Decodificador 2 entradas y 4 salidas
while True:
A = SliderA.value()
B = SliderB.value()
s3 = (not A and not B)
ledAmarillo.value(s3)
s2 = (B and not A)
ledVerde.value(s2)
s1 = (A and not B)
ledAzul.value(s1)
s0 = (A and B)
ledRojo.value(s0)