mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
17 lines
334 B
Python
17 lines
334 B
Python
from pybricks.hubs import MoveHub
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = MoveHub()
|
|
|
|
# Get the acceleration tuple.
|
|
print(hub.imu.acceleration())
|
|
|
|
while True:
|
|
# Get individual acceleration values.
|
|
x, y, z = hub.imu.acceleration()
|
|
print(x, y, z)
|
|
|
|
# Wait so we can see what we printed.
|
|
wait(100)
|