# motor a pasos con timer uso comun cada 250 ms
from machine import Pin, Timer
# Funciones
def motor(x):
A0.value(int(x[0]))
B0.value(int(x[1]))
A1.value(int(x[2]))
B1.value(int(x[3]))
def funt(t):
global i
i= i + 1
if i==4:
i=0
# Motor
A0 = Pin(5,Pin.OUT)
B0 = Pin(15,Pin.OUT)
A1 = Pin(4,Pin.OUT)
B1 = Pin(2,Pin.OUT)
# Timer
tim=Timer(0)
tim.init(period=250,mode=Timer.PERIODIC,callback=funt)
# Lista del motor
lista=["1100","0110","0011","1001"]
# Variable
i=0
while(1):
motor(lista[i])