Table of Contents

Class Adxl357

Namespace
Iot.Device.Adxl357
Assembly
Iot.Device.Adxl357.dll

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 I2cDevice

The I2C device used for communication.

accelerometerRange AccelerometerRange

The sensitivity of the accelerometer.

Fields

DefaultI2CAddress

The default I2C address of ADXL357 device.

public const byte DefaultI2CAddress = 29

Field Value

byte

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

AccelerometerRange

Temperature

Gets the current temperature in °C. Range is from −40°C to +125°C.

public Temperature Temperature { get; }

Property Value

Temperature

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 int

The number of times every axis is measured. The average of these measurements is used to calibrate each axis.

calibrationInterval TimeSpan

The 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()