from machine import Pin
import time

button1 = Pin(0,Pin.IN,Pin.PULL_DOWN)
button2 = Pin(1,Pin.IN,Pin.PULL_DOWN)
button3 = Pin(2,Pin.IN,Pin.PULL_DOWN)
d1=Pin(3,Pin.OUT)
d2=Pin(4,Pin.OUT)
d3=Pin(5,Pin.OUT)
d4=Pin(6,Pin.OUT)

while 1:
    x = button1.value()
    y = button2.value()
    z = button3.value()

    if((x==1) and (y==0) and (z==0)):
        d1.value(0)
        d2.value(0)
        d3.value(1)
        d4.value(0)
    elif((x==0) and (y==1) and (z==0)):
        d1.value(1)
        d2.value(0)
        d3.value(1)
        d4.value(0)
    elif((x==1) and (y==0) and (z==1)):
        d1.value(1)
        d2.value(0)
        d3.value(1)
        d4.value(0)
    elif((x==0) and (y==0) and (z==1)):
        d1.value(1)
        d2.value(0)
        d3.value(0)
        d4.value(0)

    elif((x==0) and (y==1) and (z==1)):
        d1.value(1)
        d2.value(0)
        d3.value(0)
        d4.value(0)
    elif((x==0) and (y==0) and (z==0)):
        d1.value(0)
        d2.value(0)
        d3.value(0)
        d4.value(0)
    elif((x==1) and (y==1) and (z==0)):
        d1.value(0)
        d2.value(0)
        d3.value(1)
        d4.value(0)
    elif((x==1) and (y==1) and (z==1)):
        d1.value(0)
        d2.value(0)
        d3.value(0)
        d4.value(0)

    


BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT