from machine import Pin
from utime import sleep_ms
dir_ = Pin(16, Pin.OUT)
step_ = Pin(17, Pin.OUT)
while True:
passos = int(input("\n🔢 Quantos passos? "))
sentido = int(input("🔄 Qual sentido? (1:horário 2:anti-horário) "))
if sentido == 1:
dir_.value(1)
else:
dir_.value(0)
for i in range(passos):
step_.value(1)
sleep_ms(1)
step_.value(0)
sleep_ms(1)