Question

So I'm writing an application to see if the device has rotated 360 degrees. The way I do this is using the Accelerometer sensor combined with the Magnetic field sensor. From this method I get three values of the X, Y and Z axes, but how can I use these to calculate where North is?

I already did some testing: When I point one of the axes north, I the value of it turns approximately 0.0, but when I point it south, it also shows me 0.0 and different values per axe when I point it east or west (For X: somewhat around -3.1 east)

Was it helpful?

Solution

Ok so I did some tests today and my solution worked for me, to just take the X value. This works for me because I only have to use it relatively (compare two values). For more information, look at the comment on my question or take look at this article.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top