Skip to content
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

Update motorkit_stepper_simpletest.py #19

Open
wants to merge 1 commit into
base: master
from

Conversation

@ladyada
Copy link
Member

ladyada commented Jul 26, 2019

add delay

add delay
@caternuson

This comment has been minimized.

Copy link
Contributor

caternuson commented Jul 29, 2019

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)
@ladyada

This comment has been minimized.

Copy link
Member Author

ladyada commented Jul 29, 2019

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!

@caternuson

This comment has been minimized.

Copy link
Contributor

caternuson commented Jul 29, 2019

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.

@ladyada

This comment has been minimized.

Copy link
Member Author

ladyada commented Jul 29, 2019

yeah i think its fine to have there too, that one is mimic'd from the original Python library

@caternuson

This comment has been minimized.

Copy link
Contributor

caternuson commented Jul 30, 2019

@ladyada

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.