import machine
from machine import Pin
ledRojo = Pin(12,Pin.OUT)
ledAzul = Pin(14,Pin.OUT)
sliderA = Pin(5,Pin.IN,Pin.PULL_UP)
sliderB = Pin(2,Pin.IN,Pin.PULL_UP)
while True:
A = sliderA.value()
B = sliderB.value()
sumador = (not A and B) or (A and not B)
#XOR = (NotA and B) or (A and notB)
carry = A and B
ledRojo.value(sumador)
ledAzul.value(carry)
print("A="+str(bool(A))+" B="+str(bool(B))+" S="+str(bool(sumador))+" C="+str(bool(carry)))