Replies: 2 comments 3 replies
-
|
Great idea. I've moved your suggestion about the slot ID to a dedicated task in #2538. However:
There should be a much easier way to accomplish this in particular. You could use a single program and do this: from pybricks.tools import hub_menu
# Make a menu to choose a letter. You can also use numbers.
selected = hub_menu("H", "S", "L")
# Based on the selection, run a program.
if selected == "H":
print("You chose H!)
elif selected == "S":
print("You chose S!)
elif selected == "L":
print("You chose L!) |
Beta Was this translation helpful? Give feedback.
1 reply
-
Can someone point to documentation or an announcement of this? How many programs can be loaded at once? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As of the latest firmware, we can now have multiple independent programs stored in the spike prime hub, selectable via the left right buttons before launching them with the middle button (great!). Is there some way to find out inside the python program, which slot was used to launch it? I tried hub.system.info() (that would seem like a good place to put it), but it's not there.
I want to have the same program in multiple slots, and have it behave differently depending on which slot was used to launch it.
Beta Was this translation helpful? Give feedback.
All reactions