import machine
from machine import Pin
#definimos salidas
ledRojoCout = Pin(14,Pin.OUT)
ledAzulS = Pin(12,Pin.OUT)
#definimos entradas
SliderCin = Pin(5,Pin.IN,Pin.PULL_UP)
SliderA = Pin(4,Pin.IN,Pin.PULL_UP)
SliderB = Pin(2,Pin.IN,Pin.PULL_UP)
while True:
Cin = SliderCin.value()
A = SliderA.value()
B = SliderB.value()
#---------------------------------------#
XOR = ((not A and B) or (A and not B))
S = ((not XOR and Cin) or (XOR and not Cin))
#---------------------------------------#
Mayoria = ((A and B) or (Cin and B) or (Cin and A))
ledRojoCout.value(Mayoria)
ledAzulS.value(S)