Ak8963 Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
AK8963 class implementing a magnetometer
public sealed class Ak8963 : IDisposable
[System.Device.Model.Interface("AK8963 class implementing a magnetometer")]
public sealed class Ak8963 : IDisposable
type Ak8963 = class
interface IDisposable
[<System.Device.Model.Interface("AK8963 class implementing a magnetometer")>]
type Ak8963 = class
interface IDisposable
Public NotInheritable Class Ak8963
Implements IDisposable
- Inheritance
-
Ak8963
- Attributes
- Implements
Constructors
Ak8963(I2cDevice) |
Default constructor for an independent AK8963 |
Ak8963(I2cDevice, Ak8963I2cBase, Boolean) |
Constructor to use if AK8963 is behind another element and need a special I2C protocol like when used with the MPU9250 |
Fields
DefaultI2cAddress |
Default I2C address for the AK8963 |
Properties
DefaultTimeout |
Default timeout to use when timeout is not provided in the reading methods |
HasDataToRead |
True if there is a data to read |
MageneticFieldGeneratorEnabled |
Get or set the device self test mode. If set to true, this creates a magnetic field Once you read it, you will have the results of the self test 14-bit output(BIT=“0”) | HX[15:0] | HY[15:0] | HZ[15:0] Criteria | -50 =< HX =< 50 | -50 =< HY =< 50 | -800 =< HZ =< -200 16-bit output(BIT=“1”) | HX[15:0] | HY[15:0] | HZ[15:0] Criteria | -200 =< HX =< 200 | -200 =< HY =< 200 | -3200 =< HZ =< -800 |
MagnetometerAdjustment |
Get the magnetometer hardware adjustment bias |
MagnetometerBias |
Get the magnetometer bias |
MeasurementMode |
Select the measurement mode |
OutputBitMode |
Select the output bit rate |
Methods
CalibrateMagnetometer(Int32) |
Calibrate the magnetometer. Make sure your sensor is as far as possible of magnet Calculate as well the magnetometer bias. Please make sure you are moving the magnetometer all over space, rotating it. Please make sure you are not close to any magnetic field like magnet or phone |
Dispose() |
Cleanup everything |
GetDeviceInfo() |
Get the device information |
IsVersionCorrect() |
Check if the version is the correct one (0x48). This is fixed for this device Page 28 from the documentation : Device ID of AKM. It is described in one byte and fixed value. 48H: fixed |
ReadMagnetometer(Boolean, Nullable<TimeSpan>) |
Read the magnetometer with bias correction and can wait for new data to be present |
ReadMagnetometer(Boolean, TimeSpan) |
Read the magnetometer with bias correction and can wait for new data to be present |
ReadMagnetometerWithoutCorrection(Boolean, Nullable<TimeSpan>) |
Read the magnetometer without Bias correction and can wait for new data to be present |
ReadMagnetometerWithoutCorrection(Boolean, TimeSpan) |
Read the magnetometer without Bias correction and can wait for new data to be present |
Reset() |
Reset the device |
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for