KELL代码加速度传感器计算角度
传感器摆放姿态:Z轴与重力加速度一个方向#include <math.h>void Angle_Acc(s16 ax, s16 ay, s16 az){ static float Ax_angle[2], Ay_angle[2], Az_angle[2]; static float R; R = ax*ax + ay*ay + az*az ; //xyz与地面夹角 Ax_angle[0] = asin(1.0000 * ax/(sqrt(R))) * 180 / 3
原创
2020-05-16 15:46:06 ·
1049 阅读 ·
0 评论