|
Treehopper C# API
|
Base class for ADC peripherals More...
Public Member Functions | |
| AdcPeripheralPin (IAdcPeripheral parent, int bitDepth, double refVoltage) | |
| Construct a new ADC pin that's part of the specified peripheral More... | |
| 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 | |
| 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 |
Base class for ADC peripherals
| AdcPeripheralPin | ( | IAdcPeripheral | parent, |
| int | bitDepth, | ||
| double | refVoltage | ||
| ) |
Construct a new ADC pin that's part of the specified peripheral
| parent | The peripheral |
| bitDepth | The ADC bitdepth |
| refVoltage | The reference voltage used to compare |
| Task MakeAnalogInAsync | ( | ) |
|
protected |
| double AnalogValue => analogValueFromAdc(AdcValue) |
The analog value (from 0-1) of the ADC pin
| double AnalogVoltage => analogVoltageFromAdc(AdcValue) |
The analog voltage of the pin
|
getset |
The reference voltage used for calculating analog voltage
|
getset |
The amount the ADC value should change before triggering an event
|
getset |
The raw ADC value
|
getset |
The amount that the analog value (0-1) should change before triggering an event
|
getset |
The change in voltage required to trigger an event
| OnAdcValueChanged AdcValueChanged |
Fires whenever the ADC value changes by the specified threshold
| OnAnalogValueChanged AnalogValueChanged |
Fires whenever the analog value changes by the specified threshold
| OnAnalogVoltageChanged AnalogVoltageChanged |
Fires whenever the analog voltage changes by the specified threshold
| PropertyChangedEventHandler PropertyChanged |