gpt4 book ai didi

arduino - 将陀螺仪/加速度计与 Arduino 结合使用

转载 作者:行者123 更新时间:2023-12-04 17:11:14 24 4
gpt4 key购买 nike

我试过 this sketch由arduino.cc提供。 (我有一个 MPU6050 GY-521 breakout board 。)

我认为它运作良好。它给出了一组奇怪的数字,我无法理解。它说这些是原始值。

如何将它们转换为有意义的值?

输出如下。即使整个事物保持静止,它也会产生变化的值(value)!这有意义吗?那么如何理解呢?

(我只知道温度值是有意义的:D)

June 2012
WHO_AM_I : 68, error = 0
PWR_MGMT_2 : 0, error = 0

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 260, 120, 15572
temperature: 31.047 degrees Celsius
gyro x,y,z : -24, -234, -240,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 304, 12, 15608
temperature: 31.000 degrees Celsius
gyro x,y,z : -7, -234, -232,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 160, 100, 15716
temperature: 31.000 degrees Celsius
gyro x,y,z : -8, -241, -248,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 192, 56, 15712
temperature: 31.000 degrees Celsius
gyro x,y,z : -36, -212, -222,

MPU-6050
Read accel, temp and gyro, error = 0
accel x,y,z: 212, 100, 15440
temperature: 30.906 degrees Celsius
gyro x,y,z : -32, -253, -240,

最佳答案

你需要看datasheet将原始值转换为有意义的值。为陀螺仪寻找这样的表格:

gyro table

如果使用默认值,FS_SEL将是 0 .这就是灵敏度设置。因此,要将原始陀螺仪值转换为每秒度数,请将它们除以 131。您可以看到您的数字低于每秒 2 度左右,这是一个合理的误差范围。

对于默认加速度计灵敏度,您除以 16,384获得以 g 为单位的值(地球施加的力)。 x 和 y 轴的重量为 0.01g,z 轴为 0.95g,这在芯片保持静止且 z 轴指向地球的合理误差范围内。

关于arduino - 将陀螺仪/加速度计与 Arduino 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12298481/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com