hello friends ? am working to calculate angle with accelometer but results are wrong ...I coulndt find the problem where it is ..let me share code and datasheet ; (mpu6050)... sensor is in constant place...
? choose afs_sel as 0 , zero-g output 50 mg is ? calculate type of lsb xy =819 z =1310,72
// 819-xy z-1310.72
G_ACCx = (double)( ((float)ACCx- 819.0f )/(16384.0f) ); // AFS_SEL=0 16,384 LSB/g DE
G_ACCy = (double)( ((float)ACCy -819.0f)/(16384.0f) ); // AFS_SEL=0 16,384 LSB/g DE
G_ACCz = (double)( ((float)ACCz -1310.72.0f)/(16384.0f) ); // AFS_SEL=0 16,384 LSB/g DE
abc=(G_ACCx*G_ACCx) + (G_ACCy*G_ACCy) + (G_ACCz*G_ACCz);
G_ACC=(double) sqrt(abc); // R^2 = Rx^2 + Ry^2 + Rz^2
ACI_ACCx= 57.2958*acos(G_ACCx / G_ACC); // Axr = arccos(Rx/R)
ACI_ACCy= 57.2958* acos(G_ACCy / G_ACC); // Ayr = arccos(Ry/R)
ACI_ACCz= 57.2958*acos(G_ACCz / G_ACC);