Class Mpu6886AccelerometerGyroscope
Mpu6886 accelerometer and gyroscope
[Interface("Mpu6886 accelerometer and gyroscope")]
public class Mpu6886AccelerometerGyroscope
- Inheritance
-
Mpu6886AccelerometerGyroscope
Constructors
Mpu6886AccelerometerGyroscope(I2cDevice)
Mpu6886 - Accelerometer and Gyroscope bus
public Mpu6886AccelerometerGyroscope(I2cDevice i2cDevice)
Parameters
i2cDevice
I2cDevice
Fields
DefaultI2cAddress
The default I2C address for the MPU6886 sensor. (Datasheet page 49) Mind that the address can be configured as well for 0x69 depending upon the value driven on AD0 pin.
public const int DefaultI2cAddress = 104
Field Value
SecondaryI2cAddress
The secondary I2C address for the MPU6886 sensor. (Datasheet page 49)
public const int SecondaryI2cAddress = 105
Field Value
Properties
AccelerometerInterruptEnabled
The axes on which the interrupt should be enabled.
public InterruptEnable AccelerometerInterruptEnabled { get; set; }
Property Value
AccelerometerLowPowerMode
Gets and sets the averaging filter settings for low power accelerometer mode. (Datasheet page 37)
public AccelerometerLowPowerMode AccelerometerLowPowerMode { get; set; }
Property Value
AccelerometerScale
Gets and sets the accelerometer full scale. (Datasheet page 37)
public AccelerometerScale AccelerometerScale { get; set; }
Property Value
EnabledAxes
Sets the enabled axes of the gyroscope and accelerometer. (Datasheet page 47)
public EnabledAxis EnabledAxes { get; set; }
Property Value
GyroscopeOffset
Gets and sets the gyroscope offset in the GyroscopeOffsetAdjustment registers of the MPU6886. Setting the offset can be usefull when a custom callibration calculation is used, instead of the Calibrate function of this class.
public Vector3 GyroscopeOffset { get; set; }
Property Value
- Vector3
GyroscopeScale
Gets and sets the gyroscope full scale. (Datasheet page 37)
public GyroscopeScale GyroscopeScale { get; set; }
Property Value
SampleRateDivider
Divides the internal sample rate (see register CONFIG) to generate the sample rate that controls sensor data output rate, FIFO sample rate. (Datasheet page 35)
public byte SampleRateDivider { get; set; }
Property Value
Methods
Calibrate(int)
Calibrate the gyroscope by calculating the offset values and storing them in the GyroscopeOffsetAdjustment registers of the MPU6886.
public Vector3 Calibrate(int iterations)
Parameters
iterations
intThe number of sample gyroscope values to read
Returns
- Vector3
The calulated offset vector
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetAccelerometer()
Reads the current accelerometer values from the registers, and compensates them with the accelerometer resolution.
public Vector3 GetAccelerometer()
Returns
- Vector3
Vector of acceleration
GetGyroscope()
Reads the current gyroscope values from the registers, and compensates them with the gyroscope resolution.
public Vector3 GetGyroscope()
Returns
- Vector3
Vector of the rotation
GetInternalTemperature()
Reads the register of the on-chip temperature sensor which represents the MPU-6886 die temperature.
public Temperature GetInternalTemperature()
Returns
- Temperature
Temperature in degrees Celcius
Reset()
Reset the internal registers and restores the default settings. (Datasheet, page 47)
public void Reset()
Sleep()
Set the chip to sleep mode. (Datasheet, page 47)
public void Sleep()
WakeUp()
Disables the sleep mode. (Datasheet, page 47)
public void WakeUp()