Treehopper C# API
Ads1115.AdsPin Class Reference

Represents an ADS1115 pin More...

Inheritance diagram for Ads1115.AdsPin:
AdcPeripheralPin AdcPin

Public Types

enum  GainControlSetting {
  mV_6144, mV_4096, mV_2048, mV_1024,
  mV_512, mV_256
}
 Gain settings More...
 

Public Member Functions

Task MakeAnalogInAsync ()
 Make the pin an analog input. More...
 

Public Attributes

double AnalogValue => analogValueFromAdc(AdcValue)
 The analog value (from 0-1) of the ADC pin More...
 
double AnalogVoltage => analogVoltageFromAdc(AdcValue)
 The analog voltage of the pin More...
 

Protected Attributes

IAdcPeripheral parent
 

Properties

GainControlSetting GainControl [get, set]
 Gets or sets the gain used by this pin More...
 
double ReferenceVoltage [get, set]
 The reference voltage used for calculating analog voltage More...
 
int AdcValueChangedThreshold [get, set]
 The amount the ADC value should change before triggering an event More...
 
int AdcValue [get, set]
 The raw ADC value More...
 
double AnalogValueChangedThreshold [get, set]
 The amount that the analog value (0-1) should change before triggering an event More...
 
double AnalogVoltageChangedThreshold [get, set]
 The change in voltage required to trigger an event More...
 

Events

OnAdcValueChanged AdcValueChanged
 Fires whenever the ADC value changes by the specified threshold More...
 
OnAnalogValueChanged AnalogValueChanged
 Fires whenever the analog value changes by the specified threshold More...
 
OnAnalogVoltageChanged AnalogVoltageChanged
 Fires whenever the analog voltage changes by the specified threshold More...
 
PropertyChangedEventHandler PropertyChanged
 

Detailed Description

Represents an ADS1115 pin

Member Enumeration Documentation

◆ GainControlSetting

enum GainControlSetting
strong

Gain settings

Enumerator
mV_6144 

6.144 V

mV_4096 

4.096 V

mV_2048 

2.048 V

mV_1024 

1.024 V

mV_512 

0.512 V

mV_256 

0.256 V

Member Function Documentation

◆ MakeAnalogInAsync()

Task MakeAnalogInAsync ( )
inherited

Make the pin an analog input.

This is unused in most implementations

Implements AdcPin.

Member Data Documentation

◆ parent

IAdcPeripheral parent
protectedinherited

◆ AnalogValue

double AnalogValue => analogValueFromAdc(AdcValue)
inherited

The analog value (from 0-1) of the ADC pin

◆ AnalogVoltage

double AnalogVoltage => analogVoltageFromAdc(AdcValue)
inherited

The analog voltage of the pin

Property Documentation

◆ GainControl

GainControlSetting GainControl
getset

Gets or sets the gain used by this pin

◆ ReferenceVoltage

double ReferenceVoltage
getsetinherited

The reference voltage used for calculating analog voltage

◆ AdcValueChangedThreshold

int AdcValueChangedThreshold
getsetinherited

The amount the ADC value should change before triggering an event

◆ AdcValue

int AdcValue
getsetinherited

The raw ADC value

◆ AnalogValueChangedThreshold

double AnalogValueChangedThreshold
getsetinherited

The amount that the analog value (0-1) should change before triggering an event

◆ AnalogVoltageChangedThreshold

double AnalogVoltageChangedThreshold
getsetinherited

The change in voltage required to trigger an event

Event Documentation

◆ AdcValueChanged

OnAdcValueChanged AdcValueChanged
inherited

Fires whenever the ADC value changes by the specified threshold

◆ AnalogValueChanged

OnAnalogValueChanged AnalogValueChanged
inherited

Fires whenever the analog value changes by the specified threshold

◆ AnalogVoltageChanged

OnAnalogVoltageChanged AnalogVoltageChanged
inherited

Fires whenever the analog voltage changes by the specified threshold

◆ PropertyChanged

PropertyChangedEventHandler PropertyChanged
inherited

The documentation for this class was generated from the following file: