-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stepper.startasync() and stepper.stopasync() #378
Comments
I do not reproduce your bug with only one motor. ( I have only one wired yet) Your code look similar to mine, except that I have added the What I see is another bug : m1.stepper = stepper.attach(m1.dir_pin, m1.step_pin, 200, 60, 6000, 100, 100)
m1.stepper:move(1000)
pio.pin.setlow(m1.en_pin)
stepper.startasync(m1.stepper)
tmr.sleepms(1000)
stepper.stop(m1.stepper) -- or stepper.stopasync(m1.stepper)
-- here come the bug
stepper.start(m1.stepper) -- or stepper.startasync(m1.stepper) Restarting a stepper after a call to m1.stepper:move(m1.stepper:getdistance())
stepper.start(m1.stepper) -- or stepper.startasync(m1.stepper) |
I see where the bug from your sample code stepper.stopasync(m1.stepper) -- all steppers stopped comes from :
the |
idn't know that startasync starts the process itself, my mistake was pio.pin.sethigh (motor.en_pin) right after stepper.startasync(motor.stepper). |
Yeah, the documentation is lacking ... But I don't know how to edit the wiki. I did not see that you disabled the motors right after the startasync() , I am glad it works for you. |
Wiki is a separate repo that can be pulled, locally modified and pushed: Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: [email protected]:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https). You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended). |
Thank you @the0ne , I will give it a try. |
commit e4d5059
could you please post some lua code demonstrating how these functions work?
my code:
The text was updated successfully, but these errors were encountered: