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

How to stop the Move Tank class #766

Open
FUJI-AF opened this issue Dec 2, 2020 · 1 comment
Open

How to stop the Move Tank class #766

FUJI-AF opened this issue Dec 2, 2020 · 1 comment

Comments

@FUJI-AF
Copy link

FUJI-AF commented Dec 2, 2020

If the question is in the wrong place, delete this question.

Is there a way to stop it when I use the follow_line method of the Move Tank class with the follow_for_forever option?

For example, exit follow_line when the touch sensor is pressed.

@WesleyJ-128
Copy link

There might (is a) be some weird hacky way to do this involving multiple threads/processes. However, there is no "nice" way to do this. What I ended up doing (I needed to stop after a certain number of encoder ticks) was copying the code from Motor.py into my own function, changing the condition that ends the loop, and using that. Not exactly nice, but it works and is cleaner than using multithreading for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants