import machine
from machine import Pin
#Salidas
ledRojo = Pin(1, Pin.OUT)
ledAzul = Pin(2, Pin.OUT)
ledVerde = Pin(3, Pin.OUT)
#Entradas
SliderA = Pin(4, Pin.IN,Pin.PULL_UP)
SliderB = Pin(5, Pin.IN,Pin.PULL_UP)
SliderC = Pin(6, Pin.IN,Pin.PULL_UP)
SliderD = Pin(7, Pin.IN,Pin.PULL_UP)
SliderE = Pin(8, Pin.IN,Pin.PULL_UP)
SliderF = Pin(9, Pin.IN,Pin.PULL_UP)
SliderG = Pin(0, Pin.IN,Pin.PULL_UP)
#Codificador Simple 7 entradas y 3 salidas
while True:
A = SliderA.value()
B = SliderB.value()
C = SliderC.value()
D = SliderD.value()
E = SliderE.value()
F = SliderF.value()
G = SliderG.value()
s2 = (D or E or F or G)
ledVerde.value(s2)
s1 = (B or C or F or G)
ledAzul.value(s1)
s0 = (A or C or E or G)
ledRojo.value(s0)