Skip to main content

Class Ads1x15Base

Base class for the Ads1x15 family of analog-to-digital (ADC) converters

Assembly: Ads1x15.dll
View Source
Declaration
public abstract class Ads1x15Base : PollingSensorBase<Voltage>, IObservable<IChangeResult<Voltage>>, ISamplingSensor<Voltage>, ISensor<Voltage>, ISensor, ISamplingSensor, II2cPeripheral

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

Derived:
Meadow.Foundation.ICs.ADC.Ads1015

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Voltage>>, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Voltage>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Voltage>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

BitResolution

Resolution of the peripheral

View Source
Declaration
protected abstract int BitResolution { get; }

ReadShiftBits

Shift required for the conversion register (see Data Sheet for details)

View Source
Declaration
protected virtual int ReadShiftBits { get; }

InternalSampleRate

Get or set the internal sample rate

View Source
Declaration
protected int InternalSampleRate { get; set; }

Channel

Gets or sets the ADC Channel settings (e.g. Single-Ended or Differential)

View Source
Declaration
public Ads1x15Base.ChannelSetting Channel { get; set; }

Gain

Gets or sets the ADC Amplifier Gain

View Source
Declaration
public Ads1x15Base.FsrGain Gain { get; set; }

Mode

Sets or gets the Measurement Mode One-shot uses less power but is slower

View Source
Declaration
public Ads1x15Base.MeasureMode Mode { get; set; }

Fields

i2cComms

I2C Communication bus used to communicate with the peripheral

View Source
Declaration
protected readonly II2cCommunications i2cComms

Methods

ReadSensor()

Reads the last ADC Conversion as a Voltage based on current Gain settings

View Source
Declaration
protected override Task<Voltage> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Voltage>: The voltage### ReadRaw() Returns the last raw ADC conversion value

View Source
Declaration
public Task<int> ReadRaw()
Returns

System.Threading.Tasks.Task<System.Int32>

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Voltage>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Voltage>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Voltage>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral