pybricks / pybricks-api

User API and documentation for Pybricks MicroPython
https://pypi.org/project/pybricks
MIT License
80 stars 23 forks source link

Document new hub_menu feature #144

Closed laurensvalk closed 10 months ago

laurensvalk commented 1 year ago

We should also add a tutorial (perhaps a video) to explain how it can be used to "store multiple programs on the hub".

Basically, it works like this:

from pybricks.tools import hub_menu

# Choose a letter.
selected = hub_menu("F", "D", "Z")

# Based on the selection, run a program.
if selected == "F":
    import fly_mission
elif selected == "D":
    import drive_mission
elif selected == "Z":
    import zigzag