Android accelerometer full range

喜你入骨 提交于 2019-12-01 01:15:09

I'm facing the same problem as yours. DISCLAIMER: I just discovered what I'm writing, so I haven't tested it at all... but I think it's in the right direction.

Checking what range is functional is quite simple: Sensor.getMaximumRange() http://developer.android.com/reference/android/hardware/Sensor.html#getMaximumRange%28%29

Now, as you know, setting the appropriate value is a much more involved thing. I believe it has to do with Android's so-called "Hardware Abstraction Layer" https://source.android.com/devices/reference/files.html

I've found this document by STMicroelectronics, who are the manufacturers of the accelerometers embedded in Samsung Galaxy SIII and S4 http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00063297.pdf

If I'm getting it right, you need to #define ACCEL_MAX_RANGE in configuration.h (page 5 of the document) as 8 or 16*GRAVITY_EARTH. There are plenty of instructions following, which I'm still trying to understand, but I think one would need to root the smartphone and compile Android from its source.

Hope this helps! If you manage to solve it, please let me know so that we can help each other.

Regards

Sorry that this is an answer and not a comment, but I don't have the rep yet. I've got a Moto X 2nd Gen, and the accelerometer has a 16-g range(+/-).

Here's the datasheet for the sensor. It's an MPU6515 from Invensense.

As ignzz stated in his/her initial post, it does not seem to be a problem from the sensor hardware, which in his/her case can also record +/-16g in principle. I believe it has to do with the settings of the operating system.

However, I haven't had time to give a try to what I described above. Has someone tried?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!