mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 09:05:07 +00:00
19 lines
400 B
Python
19 lines
400 B
Python
from pybricks.hubs import PrimeHub
|
|
from pybricks.parameters import Icon
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = PrimeHub()
|
|
|
|
while True:
|
|
# Check which side of the hub is up.
|
|
up_side = hub.imu.up()
|
|
|
|
# Use this side to set the display orientation.
|
|
hub.display.orientation(up_side)
|
|
|
|
# Display something, like an arrow.
|
|
hub.display.icon(Icon.UP)
|
|
|
|
wait(10)
|