from machine import Pin
from time import sleep

A = Pin(23,Pin.OUT)
B = Pin(22,Pin.OUT)
C = Pin(21,Pin.OUT)
D = Pin(19,Pin.OUT)
E = Pin(18,Pin.OUT)
F = Pin(17,Pin.OUT)
G = Pin(16,Pin.OUT)

def display(x):
    A.value(int(x[0]))
    B.value(int(x[1]))
    C.value(int(x[2]))
    D.value(int(x[3]))
    E.value(int(x[4]))
    F.value(int(x[5]))
    G.value(int(x[6]))
    
  
  
    
lista=['0000001','1001111','0010010','0000110','1001100','0100100','0100000','0001111','0000000','0001100','0001000','1100000','0110001','1000010','0110000','0111000']
e1= Pin(26,Pin.IN,Pin.PULL_UP)
while(1):
    if e1.value() == 1:
        for i in lista:
            display(i)
            sleep(0.5)
    else:  
        for i in range(15, -1, -1):
            display(lista[i])
            sleep(0.25)