Treehopper C# API
AdcPin Interface Reference

Base interface representing pins capable of reading analog values More...

Inheritance diagram for AdcPin:
AdcPeripheralPin AdcAnalogMux.AdcAnalogMuxPin Pin Ads1115.AdsPin Nau7802

Public Member Functions

Task MakeAnalogInAsync ()
 Make this pin an ADC pin More...
 

Properties

int AdcValue [get]
 Retrieve the last value obtained from the ADC. More...
 
double AnalogVoltage [get]
 Retrieve the last voltage reading from the ADC. More...
 
double AnalogValue [get]
 Retrieve the last reading from the ADC, expressed on a unit range (0.0 - 1.0) More...
 
double AnalogVoltageChangedThreshold [get, set]
 Gets or sets the voltage threshold required to fire the AnalogVoltageChanged event. More...
 
int AdcValueChangedThreshold [get, set]
 Gets or sets the value threshold required to fire the AdcValueChanged event. More...
 
double AnalogValueChangedThreshold [get, set]
 Gets or sets the value threshold required to fire the AnalogValueChanged event. More...
 

Events

OnAnalogVoltageChanged AnalogVoltageChanged
 Occurs when an analog voltage is changed, according to the set threshold. More...
 
OnAnalogValueChanged AnalogValueChanged
 Occurs when an analog value is changed, according to the set threshold. More...
 
OnAdcValueChanged AdcValueChanged
 Occurs when the normalized analog value is changed, according to the set threshold. More...
 

Detailed Description

Base interface representing pins capable of reading analog values

Member Function Documentation

◆ MakeAnalogInAsync()

Task MakeAnalogInAsync ( )

Make this pin an ADC pin

Implemented in Pin, AdcAnalogMux.AdcAnalogMuxPin, and AdcPeripheralPin.

Property Documentation

◆ AdcValue

int AdcValue
get

Retrieve the last value obtained from the ADC.

Treehopper has a 12-bit ADC, so ADC values will range from 0-4095.

◆ AnalogVoltage

double AnalogVoltage
get

Retrieve the last voltage reading from the ADC.

◆ AnalogValue

double AnalogValue
get

Retrieve the last reading from the ADC, expressed on a unit range (0.0 - 1.0)

◆ AnalogVoltageChangedThreshold

double AnalogVoltageChangedThreshold
getset

Gets or sets the voltage threshold required to fire the AnalogVoltageChanged event.

◆ AdcValueChangedThreshold

int AdcValueChangedThreshold
getset

Gets or sets the value threshold required to fire the AdcValueChanged event.

◆ AnalogValueChangedThreshold

double AnalogValueChangedThreshold
getset

Gets or sets the value threshold required to fire the AnalogValueChanged event.

Event Documentation

◆ AnalogVoltageChanged

OnAnalogVoltageChanged AnalogVoltageChanged

Occurs when an analog voltage is changed, according to the set threshold.

The Changed event is raised when the 12-bit ADC value obtained is different from the previous reading by at least the value specified by AnalogVoltageChangedThreshold.

◆ AnalogValueChanged

OnAnalogValueChanged AnalogValueChanged

Occurs when an analog value is changed, according to the set threshold.

The Changed event is raised when the 10-bit ADC value obtained is different from the previous reading by at least the value specified by AdcValueChangedThreshold

◆ AdcValueChanged

OnAdcValueChanged AdcValueChanged

Occurs when the normalized analog value is changed, according to the set threshold.

The Changed event is raised when the value obtained is different from the previous reading.


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