pybricksdev How to stop a program on the hub after run usb #2329
-
|
Running a program via I would like to be able to stop the program via CTRL-C. Press of the center button does stop the EV3 program. A center-button press does start (some?) program, but the output is not shown via usb. It is early days and I am very happy to be able to run programs from existing files. Bert |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is a tricky one because not everyone may want to do the same thing. For example, it would actually make the most sense for CTRL+C to send CTRL+C to the MicroPython runtime on the hub if a program is running. And CTRL+D should act as the stop signal. And there probably yet another key combination that disconnects pybricksdev without ending the program. Not sure what the keyboard shortcut for this would be though. All of this hinges on piping stdin from the terminal on your computer to stdin on the hub. This has proved quite difficult to do in pybricksdev using asyncio in a way that is cross-platform. But it is something that is on my radar. |
Beta Was this translation helpful? Give feedback.
This is a tricky one because not everyone may want to do the same thing.
For example, it would actually make the most sense for CTRL+C to send CTRL+C to the MicroPython runtime on the hub if a program is running. And CTRL+D should act as the stop signal. And there probably yet another key combination that disconnects pybricksdev without ending the program. Not sure what the keyboard shortcut for this would be though.
All of this hinges on piping stdin from the terminal on your computer to stdin on the hub. This has proved quite difficult to do in pybricksdev using asyncio in a way that is cross-platform. But it is something that is on my radar.