Example: 50-OpenMV-Boards/60-Shields/65-IMU-Shield/imu_read.py

# 本作品采用MIT许可证授权。
# 版权所有 (c) 2013-2023 OpenMV LLC。保留所有权利。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
from machine import I2C
import time

i2c = I2C(2)
imu = BNO055(i2c)
while True:
    # 温度 = imu.温度()
    # 打印('温度: ℃', 温度)
    yaw, roll, pitch = imu.euler()
    print("yaw, roll, pitch: °", yaw, roll, pitch)
    # w, x, y, z = imu.四元数()
    # 打印('四元数:', w, x, y, z)
    # x, y, z = imu.accelerometer()
    # 打印('加速度计 (m/s^2):', x, y, z)
    # x, y, z = imu.磁力计()
    # 打印('磁力计 (微特斯拉):', x, y, z)
    # x, y, z = imu.陀螺仪()
    # 打印('陀螺仪 (度/秒):', x, y, z)
    # x, y, z = imu.线性加速度()
    # 打印('线性加速度 (m/s^2)', x, y, z)
    # x, y, z = imu.重力()
    # 打印('重力 (m/s^2):', x, y, z)
    time.sleep_ms(100)

results matching ""

    No results matching ""