Class Adxl357
I2C Accelerometer ADXL357.
public class Adxl357
- Inheritance
-
Adxl357
Constructors
Adxl357(I2cDevice, AccelerometerRange)
Initializes a new instance of the Adxl357 class. ADXL357 I2C device.
public Adxl357(I2cDevice i2CDevice, AccelerometerRange accelerometerRange = AccelerometerRange.Range10G)
Parameters
i2CDevice
I2cDeviceThe I2C device used for communication.
accelerometerRange
AccelerometerRangeThe sensitivity of the accelerometer.
Fields
DefaultI2CAddress
The default I2C address of ADXL357 device.
public const byte DefaultI2CAddress = 29
Field Value
Properties
Acceleration
Gets the current acceleration in g. Range depends on the AccelerometerRange passed to the constructor.
public Vector3 Acceleration { get; }
Property Value
- Vector3
AccelerometerRange
Gets or sets the sensitivity of the accelerometer.
public AccelerometerRange AccelerometerRange { get; set; }
Property Value
Temperature
Gets the current temperature in °C. Range is from −40°C to +125°C.
public Temperature Temperature { get; }
Property Value
Methods
CalibrateAccelerationSensor(int, TimeSpan)
Calibrates the accelerometer.
You can override default samples
and calibrationInterval
if required.
public void CalibrateAccelerationSensor(int samples, TimeSpan calibrationInterval)
Parameters
samples
intThe number of times every axis is measured. The average of these measurements is used to calibrate each axis.
calibrationInterval
TimeSpanThe time in milliseconds to wait between each measurement. If null is provided, Iot.Device.Adxl357.Adxl357.CalibrationIntervalDefault in milliseconds is used.
Remarks
Make sure that the sensor is placed horizontally when executing this method.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()