|
Treehopper C# API
|
Base interface representing pins capable of reading analog values More...
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... | |
Base interface representing pins capable of reading analog values
| Task MakeAnalogInAsync | ( | ) |
Make this pin an ADC pin
Implemented in Pin, AdcAnalogMux.AdcAnalogMuxPin, and AdcPeripheralPin.
|
get |
Retrieve the last value obtained from the ADC.
Treehopper has a 12-bit ADC, so ADC values will range from 0-4095.
|
get |
Retrieve the last voltage reading from the ADC.
|
get |
Retrieve the last reading from the ADC, expressed on a unit range (0.0 - 1.0)
|
getset |
Gets or sets the voltage threshold required to fire the AnalogVoltageChanged event.
|
getset |
Gets or sets the value threshold required to fire the AdcValueChanged event.
|
getset |
Gets or sets the value threshold required to fire the AnalogValueChanged event.
| 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.
| 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
| 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.