I’m trying to get the value of the angle of my phone’s gyroscope (and then I print it on a text on the screen) but I’m not able to do it. For what I’ve understood, I have to use a quaternion so how can I get the value of an angle of the gyro let’s say for example in the y axis?
I finally found how to do it! Once you’ve understound it’s very simple you just get the values (all the axis) in the quaternion and then get a value into a float so you can get a specific axis, for now this not angle, this is value the seem to go from 0 to 1 (or -1 if depending in which you turn the phone) it shouldn’t be very hard to get angle now.
So in void update:
Ry = new Quaternion(gyroV.attitude.x, gyroV.attitude.y, gyroV.attitude.z, gyroV.attitude.w);
//my float that get the value of the z axis
RotationY = Ry.z;