import machine
from machine import Pin
S2=Pin(1, Pin.OUT)
S1=Pin(2, Pin.OUT)
S0=Pin(3, Pin.OUT)
E1=Pin(4, Pin.IN, Pin.PULL_UP)
E2=Pin(5, Pin.IN, Pin.PULL_UP)
E3=Pin(6, Pin.IN, Pin.PULL_UP)
E4=Pin(7, Pin.IN, Pin.PULL_UP)
E5=Pin(8, Pin.IN, Pin.PULL_UP)
E6=Pin(9, Pin.IN, Pin.PULL_UP)
E7=Pin(0, Pin.IN, Pin.PULL_UP)
while True:
A=E1.value()
B=E2.value()
C=E3.value()
D=E4.value()
E=E5.value()
F=E6.value()
G=E7.value()
salida2=((not A and not B and not C and D and not E and not F and not G) or (not A and not B and not C and not D and E and not F and not G) or (not A and not B and not C and not D and not E and F and not G) or (not A and not B and not C and not D and not E and not F and G))
salida1=((not A and B and not C and not D and not E and not F and not G) or (not A and not B and C and not D and not E and not F and not G) or (not A and not B and not C and not D and not E and F and not G) or (not A and not B and not C and not D and not E and not F and G))
salida0=((A and not B and not C and not D and not E and not F and not G) or (not A and not B and C and not D and not E and not F and not G) or (not A and not B and not C and not D and E and not F and not G) or (not A and not B and not C and not D and not E and not F and G))
S2.value(salida2)
S1.value(salida1)
S0.value(salida0)