import rp2
from machine import Pin
@rp2.asm_pio(set_init=rp2.PIO.OUT_LOW)
def blink():
wrap_target()
set(pins, 1) [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [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]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
nop() [31]
wrap()
# Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(0)
sm0 = rp2.StateMachine(0, blink, freq=2000, set_base=Pin(0))
# Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(25)
sm1 = rp2.StateMachine(1, blink, freq=2000, set_base=Pin(25))
# Activate the state machine 0 (external led)
sm0.active(1)
# Activate the state machine 1 (builtin led)
sm1.active(1)