import machine
from machine import Pin
#definimos salidas
ledRojoCout = Pin(14,Pin.OUT)
ledVerdeS1 = Pin(12,Pin.OUT)
ledAzulS0 = Pin(13,Pin.OUT)
#definimos entradas
SliderA1 = Pin(21,Pin.IN,Pin.PULL_UP)
SliderA0 = Pin(5,Pin.IN,Pin.PULL_UP)
SliderB1 = Pin(2,Pin.IN,Pin.PULL_UP)
SliderB0 = Pin(15,Pin.IN,Pin.PULL_UP)
while True:
A1 = SliderA1.value()
A0 = SliderA0.value()
B1 = SliderB1.value()
B0 = SliderB0.value()
#-----------------SEMI------------------------#
XORS0 = ((not A0 and B0) or (A0 and not B0))
ANDS0 = (A0 and B0)
#-----------------SUMADOR---------------------#
XOR = ((not A1 and B1) or (A1 and not B1))
S1 = ((not XOR and ANDS0) or (XOR and not ANDS0))
Mayoria = ((A1 and B1) or (A1 and ANDS0) or (B1 and ANDS0))
ledAzulS0.value(XORS0)
ledVerdeS1.value(S1)
ledRojoCout.value(Mayoria)