I just did my project for getting data gyroscope sensor. If I put my handphone on the table horizontally, the result of gyroscope sensor are : Roll (X) : 5.326322E-7 Pitch (Y) : 5.326322E-7 Yaw (Z) : 5.326322E-7
Logically, the result should be 0, because the handphone lay on the table. So,anybody can help me? I give my code below. Thank you very much for the response in advance :).
public void onSensorChanged(SensorEvent event) {
if(event.sensor.getType()==Sensor.TYPE_GYROSCOPE)
{
float roolX = event.values[0];
float pitchY = event.values[1];
float yawZ = event.values[2];
koordinatrollX.setText("Orientation X (Roll) :" + Float.toString(event.values[0]));
koordinatpitchY.setText("Orientation Y (Pitch) :" + Float.toString(event.values[1]));
koordinatyawZ.setText("Orientation Z (Yaw):" + Float.toString(event.values[2]));
}