Cancelling a subprogram on spike prime when center button is pressed #2136
Replies: 3 comments
-
There is. It raises the Depending on the skill level of the kids, I might still advocate for the more basic menu. Fully exiting means that all motors and sensors and the hub behave consistently without depending on leftover settings from your previous runs, if any. Given the demand for this feature, I think it is probably time that we add a main menu to the hub as well, but there is still some work to do before we get there. |
Beta Was this translation helpful? Give feedback.
-
|
Great! We got it working, and now my son knows a little bit about exception handling. Having a built-in way to launch different programs would be nice. We'd probably still do the menu ourselves, as we automatically advance to the next program after each one is run, and we use the bluetooth button to switch to a different utilities menu. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
|
@dsplaisted, thanks for the kind comments! They mean a lot to us :) Glad we could help (I am the coach for @FLL-Team-24277) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are using PyBricks for our First Lego League team. We have a master program that displays a menu where different sub-programs (for each of the robot runs) can be run. (That code is here.)
Ideally, we would like to be able to press the center button cancel a running subprogram (for example, if something goes wrong), and have the hub return to our main master program menu. This would be similar to how the default firmware works where the center button cancels a running program and returns to the program menu.
Is there a good way to do this? Right now we have it set up so that while a subprogram is running, pressing the center button exits the program completely, so then the center button needs to be pressed again to run the master program, then the right subprogram needs to be selected and run.
If there was a way to tell the firmware to raise a python exception when the center button was pressed, that might work. Then we could catch that exception in the master program, stop any running motors etc, and continue on with the menu.
Thanks a lot to @FLL-Team-24277 for making their repository public and sharing their experiences with PyBricks, that was a great help to our team and we based our code off of theirs.
Beta Was this translation helpful? Give feedback.
All reactions