mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 17:46:19 +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.
15 lines
286 B
Python
15 lines
286 B
Python
# ThisHub = TechnicHub PrimeHub EssentialHub
|
|
from pybricks.hubs import ThisHub
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = ThisHub()
|
|
|
|
while True:
|
|
# Read the tilt values.
|
|
pitch, roll = hub.imu.tilt()
|
|
|
|
# Print the result.
|
|
print(pitch, roll)
|
|
wait(200)
|