你的的数据波动是挺大的我用手里的BlueCoin开发板测了一下LSM6DSM结果如下
如果你还有其它LIS6DSM传感器板子可以再试另一个看下,排除传感器硬件问题
排除传感器问题后可以再看一下代码,是不是哪个地方没有配置好,
http://www.st.com/content/st_com ... e/stsw-bcnkt01.html
这个官方例程里有LIS6DSM的代码,你可以参考一下
另外传感器数据变化大还和你的测试环境振动有关,可以尽量将传感器放在比较稳定的桌面或者平台上
- Acc_X: -26, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -26, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -26, Acc_Y: -15, Acc_Z :-1052
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1021
- Acc_X: -34, Acc_Y: -15, Acc_Z :-1048
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1044
- Acc_X: -26, Acc_Y: -7, Acc_Z :-1044
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -30, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -26, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1033
- Acc_X: -22, Acc_Y: -3, Acc_Z :-1033
- Acc_X: -26, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1029
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -30, Acc_Y: -3, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -30, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -15, Acc_Z :-1025
- Acc_X: -22, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -26, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -22, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -26, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -22, Acc_Y: 0, Acc_Z :-1040
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -22, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1048
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1044
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -15, Acc_Y: 0, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1025
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -26, Acc_Y: -19, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1029
- Acc_X: -22, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -22, Acc_Y: -3, Acc_Z :-1040
- Acc_X: -22, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1021
- Acc_X: -19, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -3, Acc_Z :-1044
- Acc_X: -19, Acc_Y: -19, Acc_Z :-1052
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -19, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1044
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1044
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1029
- Acc_X: -19, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -22, Acc_Y: -3, Acc_Z :-1044
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -19, Acc_Z :-1040
- Acc_X: -15, Acc_Y: 0, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -3, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1029
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -19, Acc_Z :-1029
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -19, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1044
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -19, Acc_Z :-1040
- Acc_X: -3, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -19, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1025
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1040
- Acc_X: 8, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1029
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1021
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -3, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1029
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -3, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -15, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1029
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1048
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -3, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -15, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -3, Acc_Y: -15, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -3, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1036
- Acc_X: -19, Acc_Y: -11, Acc_Z :-1033
- Acc_X: -3, Acc_Y: -7, Acc_Z :-1033
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1036
- Acc_X: 0, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -11, Acc_Y: -7, Acc_Z :-1029
- Acc_X: -3, Acc_Y: -7, Acc_Z :-1040
- Acc_X: -3, Acc_Y: -11, Acc_Z :-1040
- Acc_X: -7, Acc_Y: -15, Acc_Z :-1036
- Acc_X: -3, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -7, Acc_Y: -11, Acc_Z :-1036
- Acc_X: -11, Acc_Y: -3, Acc_Z :-1036
- Acc_X: 12, Acc_Y: -7, Acc_Z :-1033
复制代码
|