Hi, Try logging the data received with timestamps ( in memory ) for android.hardware.SensorListener.onSensorChanged(int sensor, float[] values) and you'll soon work out the Frequency, I have found accelerometer updates being received at approximately 30~40ms intervals on a G1 eg:
1227266554492 2 [0] = 0.16344418 [1] = -9.629586 [2] = -1.3620348 [3] = 0.16344418 [4] = -9.629586 [5] = -1.3620348 1227266554495 1 [0] = 7.3883734 [1] = -82.0 [2] = 1.0 [3] = 7.3883734 [4] = -82.0 [5] = 1.0 1227266554525 8 [0] = 8.3125 [1] = 12.875 [2] = -71.5625 [3] = 8.3125 [4] = 12.875 [5] = -71.5625 1227266554528 2 [0] = 0.05448139 [1] = -9.684067 [2] = -1.3075534 [3] = 0.05448139 [4] = -9.684067 [5] = -1.3075534 1227266554531 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554564 8 [0] = 8.5625 [1] = 12.125 [2] = -71.5625 [3] = 8.5625 [4] = 12.125 [5] = -71.5625 1227266554566 2 [0] = 0.040861044 [1] = -9.670447 [2] = -1.3211738 [3] = 0.040861044 [4] = -9.670447 [5] = -1.3211738 1227266554603 8 [0] = 8.0625 [1] = 12.375 [2] = -71.8125 [3] = 8.0625 [4] = 12.375 [5] = -71.8125 1227266554606 2 [0] = -0.013620348 [1] = -9.724928 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.724928 [5] = -1.2666923 1227266554609 1 [0] = 7.5050936 [1] = -83.0 [2] = 0.0 [3] = 7.5050936 [4] = -83.0 [5] = 0.0 1227266554643 8 [0] = 8.3125 [1] = 12.375 [2] = -71.8125 [3] = 8.3125 [4] = 12.375 [5] = -71.8125 1227266554646 2 [0] = -0.013620348 [1] = -9.615966 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.615966 [5] = -1.2666923 1227266554649 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554683 8 [0] = 7.8125 [1] = 11.625 [2] = -71.5625 [3] = 7.8125 [4] = 11.625 [5] = -71.5625 1227266554686 2 [0] = 0.040861044 [1] = -9.615966 [2] = -1.2666923 [3] = 0.040861044 [4] = -9.615966 [5] = -1.2666923 (These examples were when using SENSOR_DELAY_GAME rate, you can probably do better if you listen just for the accelerometer updates and use a faster RATE) You can also vary this Frequency (rate) with android.hardware.SensorManager.registerListener(SensorListener listener, int sensors, int rate) int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rate suitable for the user interface I can't help you with the Precision, maybe have a look at android.hardware.SensorListener.onAccuracyChanged (int sensor, int accuracy). Another idea is to find the specs for the sensor being used in the g1 or g2, but there is nothing like measuring it for yourself.... Regards On Feb 17, 8:39 pm, ashu <[email protected]> wrote: > So my question still stands. Frequency? Precision? Thanks for the > attempt, Jubei. > > On Feb 11, 6:14 am, Jubei <[email protected]> wrote: > > > Supposedly you pass a 3rd parameter to the sensormanager's > > registerLister function but It doesnt seem to make any difference. > > > On Feb 11, 7:33 pm,ashu<[email protected]> wrote: > > > > Hey, I wanted to get the frequency of accelerometer output. How many > > > readings can I get per second? And to what precision do I get? Thanks- > > > Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

