WARNING: This command has become obsolete following the v2.1 release. The feature has been added to the global SetFusionType command.

The LockHeadingReference command is used to lock magnetometer readings to represent the 0 degrees reference heading. When this function is called, Neblina will wait until the device is positioned on either a horizontal or vertical plane and then the current magnetometer readings will be locked to the zero degrees heading. Therefore, whenever the device points back to the same direction, Neblina will provide correction for the heading angle to reach the reference 0 degrees. The correction is adaptive meaning that if the deviation of the heading angle caused by the Gyroscopes' drift is high enough at the reference heading angle, the correction will be aggressive. However, if the heading info is close to the zero degrees (<15 degrees), the correction will apply smoothly. After setting the 0 degree reference, Neblina will pick up more reference heading angles using the gyroscope integration as the device moves, and will keep those additional points for further heading corrections. Currently, Neblina locks to a maximum of 4 reference heading angles.



This command uses the Command-Ack protocol.

Byte Name C Type Value
0 Control Byte ( Packet Type (7:5) / SubSystem (4:0) ) uint8_t 0x41 ( 0b010 / 0b00001 )
1 Payload Length uint8_t 0
2 CRC uint8_t Calculated
3 Command uint8_t 0x0D


This command contains no payload