# stepper motor simulation
from machine import Pin, PWM
import time
step_pin=PWM(Pin(4))
dir_pin=Pin(2,Pin.OUT)
ms1=Pin(19,Pin.OUT)
ms2=Pin(18,Pin.OUT)
ms3=Pin(5,Pin.OUT)
while True:
#clockwise full step
ms1.off()
ms2.off()
ms3.off()
step_pin.freq(100)
dir_pin.off()
time.sleep(20)
#clockwise half step
ms1.on()
ms2.off()
ms3.off()
step_pin.freq(100)
dir_pin.on()
time.sleep(20)