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

Prevent "stop" button on mindstorm from exiting the program #764

Open
foocross opened this issue Oct 27, 2020 · 1 comment
Open

Prevent "stop" button on mindstorm from exiting the program #764

foocross opened this issue Oct 27, 2020 · 1 comment

Comments

@foocross
Copy link

We are running the latest version of ev3dev with python

We are trying to catch the exception during a program run so that it does not cause the program to exit. We tried:

try:
  <run some code>
except:
  pass
<rest of the program>

Is there another way to catch when the stop button is pressed? Or is there a way to watch for another button to be pressed during normal ewxecution?

@WesleyJ-128
Copy link

Trying to intercept the stop button command sounds like a bad idea (something goes wrong, program can no longer be stopped). However, using multiprocessing, you can listen for button presses while something else is running. Here's an example.

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