# Importamos módulos:
from machine import Pin
import utime

# Objeto:
a = Pin(22, Pin.OUT)
b = Pin(21, Pin.OUT)
c = Pin(19, Pin.OUT)
d = Pin(18, Pin.OUT)
e = Pin(5, Pin.OUT)
f = Pin(4, Pin.OUT)
g = Pin(2, Pin.OUT)

# Función:
def Ssegmentos (A,B,C,D,E,F,G):
    a.value(A)
    b.value(B)
    c.value(C)
    d.value(D)
    e.value(E)
    f.value(F)
    g.value(G)

# Ciclo:
while True:
    Ssegmentos(1,1,1,1,1,1,0)# 0
    utime.sleep(1)

    Ssegmentos(0,1,1,0,0,0,0)# 1
    utime.sleep(1)

    Ssegmentos(1,1,0,1,1,0,1)# 2
    utime.sleep(1)

    Ssegmentos(1,1,1,1,0,0,1)# 3
    utime.sleep(1)

    Ssegmentos(0,1,1,0,0,1,1)# 4
    utime.sleep(1)

    Ssegmentos(1,0,1,1,0,1,1)# 5
    utime.sleep(1)

    Ssegmentos(0,0,1,1,1,1,1)# 6
    utime.sleep(1)

    Ssegmentos(1,1,1,0,0,0,0)# 7
    utime.sleep(1)

    Ssegmentos(1,1,1,1,1,1,1)# 8
    utime.sleep(1)

    Ssegmentos(1,1,1,0,0,1,1)# 9
    utime.sleep(1)