0

I am using react-native-sensors mangetometer to create a compass based application.

There are 2 questions that i need help on :- 1

  1. The react native sensor magnetometer by default points 0 degrees at east where as it should be pointing to 0 degree to North ideally. ( To solve this a 90 degree adjustment was added ) . How can i make ( where as it should be pointing to 0 degree to North ) this possible ?

  2. The compass re rotates once it reaches the 271 degree mark which is not ideal in terms of ux. I am not able to understand why this happens.

Here is the link of the code i have used for Point 1 :-

https://github.com/rahulhaque/compass-react-native/blob/master/App.js

Here is the gif for point 2 :-

https://drive.google.com/file/d/1YjltGc-m33YKbrkrRwNvwYsbYuk2a5Nk/view?usp=sharing

Also is there any other way i can use the compass functionallity in react native ?

Soumil_13
  • 17
  • 4
  • For 2 **(rotates once it reaches the 271 degree)**, because you have added 90 degree (as "adjustment" you want) in the first place. – Ken Lee Oct 13 '21 at 09:48
  • So the issues are interdependent on each other. In this case how do i try to solve the point 1 ? – Soumil_13 Oct 13 '21 at 10:05

0 Answers0