Open minhanh1234 opened 3 months ago
Hi @minhanh1234, you can use the magnetometer data to make a compass out of it. You would need to determine the max and min values for the x- and y-axes and then interpolate your measured values to determine the direction. However, the magnetic field strength depends on your location (e.g. inside and outside of buildings) or other factors like electric devices which are near to the module. Another factor to consider is that if you vary the z-angle, it will also influence the magnetic measurements. I tried a bit, the it became too complex and I gave up. The other option to determine the direction of the x- and y-direction (yaw-angle) is to constantly measure gyroscope data: angle/time * time = angle. Of course, you will have certain error when using this method and the errors can add up over time. So, in summary, basically it's possible, but I do not have plans to implement this as a feature. Hope this helps a bit.
Hi
Would you know if this chip can calculate compass angle like most magnetometer and would you have any example code to calculate rotation count? Example if i rotate the gyro on a table? (Example: 2 counter clockwise ration)
Thanks