mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 09:05:07 +00:00
This way we don't have to commit the generated scripts. While we do this, rename ExampleHub to ThisHub so that the common scripts can actually run.
16 lines
345 B
Python
16 lines
345 B
Python
# ThisHub = TechnicHub PrimeHub EssentialHub
|
|
from pybricks.hubs import ThisHub
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = ThisHub()
|
|
|
|
# Get the acceleration vector in g's.
|
|
print(hub.imu.acceleration() / 9810)
|
|
|
|
# Get the angular velocity vector.
|
|
print(hub.imu.angular_velocity())
|
|
|
|
# Wait so we can see what we printed
|
|
wait(5000)
|