Skip to main content

Class Adxl3xxBase

Base class for ADXL335, ADXL337, and ADXL377 triple axis accelerometers

Assembly: Adxl3xx.dll
View Source
public abstract class Adxl3xxBase : PollingSensorBase<Acceleration3D>, IObservable<IChangeResult<Acceleration3D>>, IAccelerometer, ISamplingSensor<Acceleration3D>, ISensor<Acceleration3D>, ISensor, ISamplingSensor, IDisposable

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT> -> Meadow.Foundation.PollingSensorBase<UNIT>

Derived:
Meadow.Foundation.Sensors.Motion.Adxl335, Meadow.Foundation.Sensors.Motion.Adxl337, Meadow.Foundation.Sensors.Motion.Adxl377

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Acceleration3D>>, Meadow.Peripherals.Sensors.Motion.IAccelerometer, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable

Properties

XAnalogInputPort

The X analog input port

View Source
protected IAnalogInputPort XAnalogInputPort { get; }

YAnalogInputPort

The Y analog input port

View Source
protected IAnalogInputPort YAnalogInputPort { get; }

ZAnalogInputPort

The Z analog input port

View Source
protected IAnalogInputPort ZAnalogInputPort { get; }

SupplyVoltage

Power supply voltage applied to the sensor - this will be set (in the constructor) to 3.3V by default

View Source
protected Voltage SupplyVoltage { get; }

GravityRange

Gravity range

View Source
protected double GravityRange { get; }

Acceleration3D

The current acceleration value

View Source
public Acceleration3D? Acceleration3D { get; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

ReadSensor()

Reads data from the sensor

View Source
protected override Task<Acceleration3D> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Acceleration3D>: The latest sensor reading### VoltageToGravity(Voltage) Convert voltage to gravity

View Source
protected Acceleration VoltageToGravity(Voltage voltage)
Returns

Meadow.Units.Acceleration: Acceleration value

Parameters
TypeNameDescription
Meadow.Units.VoltagevoltageThe voltage to convert

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Acceleration3D>>
  • Meadow.Peripherals.Sensors.Motion.IAccelerometer
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Acceleration3D>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Acceleration3D>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable