Closed ladyada closed 4 years ago
I think examples/motorkit_stepper_test.py
also needs this patch? It has the same loops.
How about making the delay a const like thing? That way it can be tweaked as needed easily. Esp. since there are multiple loops in examples/motorkit_stepper_test.py
.
STEP_DELAY = 0.01
for i in range(100):
kit.stepper1.onestep()
time.sleep(STEP_DELAY)
yeah i didnt get to work on the test/code this weekend, but all the examples that have a stepper should have a STEP_DELAY!
Oh yeah, there's also examples/motorkit_dual_stepper_test.py
which is multi-threaded. I think time.sleep()
is OK there? It blocks thread, not process.
yeah i think its fine to have there too, that one is mimic'd from the original Python library
Hmm. Maybe time.sleep is too crude? https://forums.adafruit.com/viewtopic.php?f=31&t=154221&start=15#p762855
we used sleep in the previous library https://github.com/adafruit/Adafruit-Motor-HAT-Python-Library/blob/master/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py#L159
Just trying to make sure / remember - this PR was for #18, right?
yah i htink so!
@caternuson This has been hanging for a while. Any reason not to approve this?
@dhalbert not that i can remember. if there is anything, can just reopen.
add delay