import machine
from machine import Pin
#Salidas primer bit led azul, segundo bit led rojo
ledRojo = Pin(1, Pin.OUT)
ledAzul = Pin(2,Pin.OUT)
#Entradas primer bit slider A, segundo bit slider B
SliderA = Pin(4, Pin.IN,Pin.PULL_UP)
SliderB = Pin(5, Pin.IN,Pin.PULL_UP)
#Tabla de verdad de la suma de 2 numeros de 1 bit
# A | B | Azul | Rojo
# --------------------------------
# 0 | 0 | 0 | 0
# 0 | 1 | 0 | 1
# 1 | 0 | 0 | 1
# 1 | 1 | 1 | 0
while True:
A = SliderA.value()
B = SliderB.value()
primerBit = (A and B)
ledAzul.value(primerBit)
segundoBit = ((not A and B) or (A and not B))
ledRojo.value(segundoBit)