private void Reconfigure()
        {
            DirectAccess.Write(new[] { CTRL_REG0, (byte)0 });  // normal mode, FIFO disabled, high-pass filter disabled

            DirectAccess.Write(new[] { CTRL_REG1, (byte)((byte)AccelerationDataRate | (byte)AccelerationDataUpdateMode | (byte)AccelerationAxes) });
            DirectAccess.Write(new[] { CTRL_REG2, (byte)AccelerationScale });

            DirectAccess.Write(new[] { CTRL_REG3, (byte)0 }); // interrupt 1 disabled
            DirectAccess.Write(new[] { CTRL_REG4, (byte)0 }); // interrupt 2 disabled

            DirectAccess.Write(new[] { CTRL_REG5, (byte)((byte)MagneticResolution | (byte)MagneticDataRate) });
            DirectAccess.Write(new[] { CTRL_REG6, (byte)MagneticScale });
            DirectAccess.Write(new[] { CTRL_REG7, (byte)MagneticMode });
        }
Exemple #2
0
        private void Reconfigure()
        {
            // XL Axen (SD: XYZ) gesetzt, Soft iron algorithmus aus
            DirectAccess.Write(new[] { CTRL9_XL, (byte)LSM6DS3AccelerationAxes });

            // Set Block data update (SD: disabled)
            DirectAccess.Write(new[] { CTRL3_C, (byte)LSM6DS3BlockDataUpdate });

            // XL Daterate gesetzt (SD: 416HZ), XL Skalierung gesetzt (SD: 2g), AnalogFilterBandwith gesetzt (Standard 400hz)
            DirectAccess.Write(new[] { CTRL1_XL, (byte)((byte)LSM6DS3AccelerationDataRate | (byte)LSM6DS3AccelerationScale | (byte)LSM6DS3AccelerationAnalogFilterBandwith) });

            // G Axen (SD: XYZ) aktiviert, embedded functions disabled
            DirectAccess.Write(new[] { CTRL10_C, (byte)LSM6DS3GyroAxes });

            // G Datenrate gesetzt (SD: 416HZ), G Skalierung gesetzt (SD: 250dps)
            DirectAccess.Write(new[] { CTRL2_G, (byte)((byte)LSM6DS3GyroDataRate | (byte)LSM6DS3GyroScale) });
        }