Hello
I am trying to get the angle of the sensor using the value of mpu6050.
I used a formula to obtain an angle using sensor values. However, if I calculate this expression and print it out, the value will only be zero.
static void send_data() //send to app
{
uint32_t err_code;
double angle_x, angle_y, angle_z;
accel_values_t accel_values; //mpu6050
app_mpu_read_accel(&accel_values);
err_code = app_mpu_read_accel(&accel_values);
APP_ERROR_CHECK(err_code);
//Angle test
const double RADIAN_TO_DEGREE = 180 / 3.14159; //Pi
angle_y = atan(-accel_values.x / sqrt(pow(accel_values.y,2) + pow(accel_values.z, 2)));
angle_y *= RADIAN_TO_DEGREE;
angle_x = atan(accel_values.y / sqrt(pow(accel_values.x,2) + pow(accel_values.z, 2)));
angle_x *= RADIAN_TO_DEGREE;
printf("Angle_X : %lf\n", angle_x);
printf("Angle_Y : %lf\n", angle_y);
nrf_delay_ms(500);
}

Can I know the problem with this?
Thank you.