mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
pybricks.tools: Document hub_menu.
Fixes https://github.com/pybricks/pybricks-api/issues/144
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user