from machine import Pin
import time

switches_grupo1 = [Pin(i, Pin.IN) for i in [12, 13, 14, 15]]
switches_grupo2 = [Pin(i, Pin.IN) for i in [16, 17, 18, 19]]
leds = [Pin(i, Pin.OUT) for i in [26, 27, 28, 4, 5]]

def leer_switches(switches):
    return sum(switch.value() << i for i, switch in enumerate(switches))

def actualizar_leds(resultado):
    for i, led in enumerate(leds):
        led.value((resultado >> i) & 1)

def sumador_binario():
    while True:
        a = leer_switches(switches_grupo1) 
        b = leer_switches(switches_grupo2)  
        resultado = a + b   
        actualizar_leds(resultado)
        time.sleep_ms(10)

sumador_binario()
$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT