I want to
[1] Increase Sampling Rate of my phone's accelerometer. (SENSOR_DELAY_FASTEST gives max. about 100Hz on Xperia/ 180Hz on Nexus4, I want delay to be about 1ms or less for my work.
[2] If [1] not possible can i make Rate constant.
mSensorManager.registerListener(this, mAccelerometer,10000);//10000 in microsec
Above code doesn't give me 10ms delay. I know it's only a suggestion to Android.
I know These accelerometers inside phones are capable of giving much smaller delay. It's mentioned in their datasheets. So is their any method or driver/ADC programming to do [1] or [2]. I'm using ADT tools. Any other tool to do this?
P.S: I've read
Android: How to increase Accelerometer Sampling Rate?
Impossibility to change the rate of the accelerometer
By default, the accelerometer sample rate is 100Hz (100 times per second).
Typical phone accelerometer chips resolve +/- 2g @ 12 bits providing 1024 bits over full range or 0.0643 ft/sec^2 lsb. The rate of sampling depends on clock speeds and overall configuration. Typical rates enable between one and 400 samples per second, with faster rates offering lower accuracy.
The accelerometer is an in-built comment of a smartphone to measure its acceleration. It tracks the different motion like shaking, tilting, swinging, and rotating and accordingly change the orientation of your app.
Open the Phone app and tap Keypad, then type *#0*#. A diagnostic screen pops up with buttons for a variety of tests. Tap Red, Green, or Blue to test those pixel colors. Tap Receiver to check the audio, Vibration to try the vibrating feature, or Sensor to test the accelerometer and other sensors.
From developer.android.com :
The data delay (or sampling rate) controls the interval at which sensor events are sent to your application via the onSensorChanged() callback method. The default data delay is suitable for monitoring typical screen orientation changes and uses a delay of 200,000 microseconds. You can specify other data delays, such as SENSOR_DELAY_GAME (20,000 microsecond delay), SENSOR_DELAY_UI (60,000 microsecond delay), or SENSOR_DELAY_FASTEST (0 microsecond delay). As of Android 3.0 (API Level 11) you can also specify the delay as an absolute value (in microseconds).
But you should know the absolute value you specify in microseconds is only a suggestion to Android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With