mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
imu shield example
This commit is contained in:
parent
06c2b72caf
commit
4158ee89cc
23
scripts/examples/29-IMU-Shield/imu_read.py
Normal file
23
scripts/examples/29-IMU-Shield/imu_read.py
Normal file
@ -0,0 +1,23 @@
|
||||
from machine import I2C
|
||||
from bno055 import BNO055, AXIS_P7
|
||||
import time
|
||||
i2c = I2C(2)
|
||||
imu = BNO055(i2c)
|
||||
while True:
|
||||
#temperature = imu.temperature()
|
||||
#print('temperature: ℃',temperature)
|
||||
yaw, roll, pitch = imu.euler()
|
||||
print('yaw, roll, pitch: °', yaw, roll, pitch)
|
||||
#w, x, y, z = imu.quaternion()
|
||||
#print('Quaternion:', w, x, y, z)
|
||||
#x, y, z = imu.accelerometer()
|
||||
#print('Accelerometer (m/s^2):', x, y, z)
|
||||
#x, y, z = imu.magnetometer()
|
||||
#print('Magnetometer (microteslas):', x, y, z)
|
||||
#x, y, z = imu.gyroscope()
|
||||
#print('Gyroscope (deg/sec):', x, y, z)
|
||||
#x, y, z = imu.linear_acceleration()
|
||||
#print('Linear acceleration (m/s^2)', x, y, z)
|
||||
#x, y, z = imu.gravity()
|
||||
#print('Gravity (m/s^2):', x, y, z)
|
||||
time.sleep(100)
|
||||
Loading…
Reference in New Issue
Block a user