Table of Contents

Class Ads1115

Namespace
Pamoja.Sensors
Assembly
Pamoja.Sensors.dll

A TI ADS1115 16-bit analogue-to-digital converter.

public static class Ads1115
Inheritance
Ads1115
Inherited Members

Fields

ConfigReset

The value the configuration register reads after a reset.

public const ushort ConfigReset = 34179

Field Value

ushort

Methods

ConfigBits(Ads1115Config)

Assembles the 16-bit configuration register value.

public static ushort ConfigBits(Ads1115Config config)

Parameters

config Ads1115Config

The settings to encode.

Returns

ushort

The register value to write, most significant bit first.

ConfigFromBits(ushort)

Parses a 16-bit configuration register value.

public static Ads1115Config ConfigFromBits(ushort bits)

Parameters

bits ushort

The register value, as read from the device.

Returns

Ads1115Config

The decoded settings. Every value decodes, so this never throws.

Exceptions

PamojaException

The native call failed.

FullScaleMicrovolts(byte)

Returns the full-scale range a gain code selects.

public static uint FullScaleMicrovolts(byte pga)

Parameters

pga byte

The gain code, 0 to 7.

Returns

uint

The full scale in microvolts.

SamplesPerSecond(byte)

Returns the sample rate a data-rate code selects.

public static ushort SamplesPerSecond(byte dataRate)

Parameters

dataRate byte

The data-rate code, 0 to 7.

Returns

ushort

The rate in samples per second.

ToNanovolts(byte, short)

Converts a raw conversion result to nanovolts.

public static long ToNanovolts(byte pga, short raw)

Parameters

pga byte

The gain the conversion was taken at.

raw short

The signed conversion register value.

Returns

long

The measured voltage, exact at every gain setting.

ToVolts(byte, short)

Converts a raw conversion result to volts.

public static float ToVolts(byte pga, short raw)

Parameters

pga byte

The gain the conversion was taken at.

raw short

The signed conversion register value.

Returns

float

The measured voltage.