# Non-blocking stepper example
from stepper import Stepper

motor = Stepper(2048, 5, 6, 13, 19)
motor.set_speed(10)
motor.start(1024) # can call in the main loop as well on certain event

while True:
    t = motor.tick()
    # run other commands while the motor works
    # or sleep(max(t, 0.0001))
    if motor.steps_left <= 0:
        break