import machine
from machine import Pin
#definimos salida
ledRojo = Pin(12,Pin.OUT)
#definimos entrada
SliderA = Pin(4,Pin.IN,Pin.PULL_UP)
SliderB = Pin(2,Pin.IN,Pin.PULL_UP)
#Las conectamos con el Pull Up interno
#asi nos evitamos la resistencia
while True:
A = SliderA.value()
B = SliderB.value()
#Tabla de verdad de XOR
# A | B | XOR
#---------------
# 0 | 0 | 0
# 0 | 1 | 1
# 1 | 0 | 1
# 1 | 1 | 0
xor = (not A and B) or (A and not B )
ledRojo.value(xor)
print("A="+str(bool(A))+" B="+str(bool(B))+" Xor="+str(bool(xor)))