Shop OBEX P1 Docs P2 Docs Learn Events
How to Convert XYZ output from Accelerometer to Degree only ? — Parallax Forums

How to Convert XYZ output from Accelerometer to Degree only ?

AzoelharmanAzoelharman Posts: 1
edited 2013-02-02 21:40 in Accessories
​I used MMA7455 3-Axis Accelerometer Module, and i want to convert XYZ output from accelerometer to be degree only.
Help me to create the code in BS2SX, to convert this output. Or what anyone have the code ?
Please share it :)

Comments

  • kwinnkwinn Posts: 8,697
    edited 2013-02-02 21:25
    Do you want to convert each axis to degrees or convert all 3 to a vector and acceleration value with respect to some arbitrary axis relative to the accelerometer?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-02-02 21:40
    I discussed the mathematics involved with computing the angle based on the precision of an accelerometer in this post.

    I'm sure there are many places online that give a better explanation than mine. The angle calculation will depend on the precision and range of the accelerometer. You will likely need to use the arcsine function to calculate the angle of tilt from the raw accelerometer value.
Sign In or Register to comment.