import machine
from machine import Pin
#ENTRADA
A_in = Pin(19, Pin.IN, Pin.PULL_UP)
B_in = Pin(15, Pin.IN, Pin.PULL_UP)
C_in = Pin(4, Pin.IN, Pin.PULL_UP)
#SALIDA
led_suma = Pin(13, Pin.OUT)
led_carry = Pin(14, Pin.OUT)
while True:
A = A_in.value()
B = B_in.value()
C = C_in.value()
XorAB = (not A and B) or (A and not B)
Suma = (not C and XorAB) or (C and not XorAB)
Carry = (A and B) or (A and C) or (B and C)
led_suma.value(Suma)
led_carry.value(Carry)