from machine import Pin, Timer
from time import sleep
led = Pin (27, Pin.OUT)
i = 0
def piscaPisca(t):
global led # Importa as variáveis globais
led (not led())
t = Timer()
t.init(freq=2, # Ou freq=2, 2 vezes por segundo
mode=Timer.PERIODIC,
callback=piscaPisca)
while True:
print (f"Momento: {i}")
sleep(1) # Em segundos
i = i + 1