0

I am displaying and checking the values of gyroscope via my Nexus mobile device.Earlier I used to get the values as soon as connect my device.However, I also checked by using Log.v as in case if the listener is getting called, and it is working.But I am unable to get the actual "numerical" values on the the locat file.Thanks in advance

private SensorEventListener gyroscope_listener = new SensorEventListener() {

        public void onSensorChanged(SensorEvent event) {


            gyro_x = event.values[0];
            gyro_y = event.values[1];
            gyro_z = event.values[2];

            Log.v("GYRO-X" , "gyro_x");
            //Log("testgyro"+gyro_x);
            Log3("----- gyroscope sensor  -------");
            Log3("Gyro-x" + gyro_x);
            Log3("Gyro-y" + gyro_y);
            Log3("Gyro-z" + gyro_z);
            Log3("----- gyroscope sensor  -------");
        }

        public void onAccuracyChanged(Sensor sensor, int accuracy) {

        }
    };
Shweta
  • 807
  • 3
  • 11
  • 24

1 Answers1

1
  1. What is Log3?! Maybe you have a spelling mistake?

  2. You should debug it and ask yourself: "Does your program even enter that part of code?" - maybe it doesn't!

Ryan M
  • 18,333
  • 31
  • 67
  • 74
Radu
  • 2,076
  • 2
  • 20
  • 40