pybricks.tools: Document hub_menu.

Fixes https://github.com/pybricks/pybricks-api/issues/144
This commit is contained in:
Laurens Valk
2023-10-24 16:23:59 +02:00
parent 8819446513
commit faf11581c0
5 changed files with 46 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
from pybricks.tools import hub_menu
# This example assumes that you have three other programs in Pybricks Code,
# called "fly_mission", "drive_mission", and "zigzag". This example creates a
# menu that lets you pick which one to run.
# 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