Android acceleration sensor (G-sensor)

Source: Internet
Author: User

The android accelerometer is of the sensor. type_accelerometer type.

Return the value of the accelerometer through Android. Hardware. sensorevent.

The Unit returned by the accelerometer is the unit of acceleration m/s ^ 2 (meter per second). The values in three directions are

Values [0]: X-axis Acceleration

Values [1]: acceleration in Y-axis direction

Values [2]: acceleration in the z-axis direction

The X, Y, and Z directions are defined as the coordinates of the reference system (such as) on the Right and bottom of the horizontally placed mobile phone)

The Direction X is the horizontal direction of the mobile phone, and the right is positive

The Y direction is the horizontal vertical direction of the mobile phone, and the front is positive

The Y direction is the vertical direction of the mobile phone space, the direction of the sky is positive, and the direction of the earth is negative

X <0 x> 0
^
|
+ ----------- + --> Y> 0
|
|
|
|/Z <0
|/
|/
O ----------- +/
| [] [] []/
+ ----------/+ Y <0
/
/
|/Z> 0 (toward the sky)

O: origin (x = 0, y = 0, Z = 0)

Note that due to the inherent gravity acceleration G of the Earth (the value is 9.8 Mb/s ^ 2 ),

Therefore, in reality, the actual acceleration value should be the Z-direction return value-9.8 m/s ^ 2.

For example, if you throw a mobile phone at the acceleration of 2 Mb/s ^ 2, then the return value in the z direction is 11.8 Mb/s ^ 2.

Otherwise, if the mobile phone drops at a 2 Mbit/s ^ 2 acceleration, the return value in the z direction should be 7.8 Mbit/s ^ 2.

In the X and Y directions, there is no such restriction.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.