Files
pybricks-api/examples/pup/hub_essentialhub/imu_read_vector.py
T
David Lechner 03ee7f74e8 doc/pup/essentialhub: fix bit rot
This fixes bitrot for PR #96. Also fixes a few minor issues where
changes were missed.
2022-06-29 12:08:33 -05:00

15 lines
310 B
Python

from pybricks.hubs import EssentialHub
from pybricks.tools import wait
# Initialize the hub.
hub = EssentialHub()
# 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)