import time
from rp2 import PIO, StateMachine, asm_pio
from machine import Pin
PIN_BASE = 10
@asm_pio(set_init=PIO.OUT_LOW)
def blink():
set(pins, 1) [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
set(pins, 0) [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
sm = StateMachine(0, blink, freq=2000, set_base=Pin(PIN_BASE))
sm.active(1)
time.sleep(4)
sm.active(0)