1

As I know, the most of android devices allows to detect rotation by accelerometer, but I've noticed, that it doesn't detect rotation parallel to the ground. For example, if I put the device on a table and turn it around, no one of accelerometer indicators doesn't change.

enter image description here

At the picture, it's called "alfa" rotation. So how can I detect this kind of turning?

Maksim I. Kuzmin
  • 1,170
  • 7
  • 16

1 Answers1

1

For sensing rotation around z-axis you need to implement a compass function. A good tutorial is this one. To make the resulting values more stable you need to implement some algorithm which smoothes your incoming data (averages over a queue of data, filtering outliers, etc.). Here is a good overview.

Community
  • 1
  • 1
kalabalik
  • 3,792
  • 2
  • 21
  • 50