Treehopper Python API
AdcPin Class Reference

Represents an ADC pin. More...

Inheritance diagram for AdcPin:
Pin

Public Member Functions

def __init__ (bit_depth, max_voltage)
 

Public Attributes

 max_voltage
 
 analog_voltage_changed
 (EventHandler) an event that fires with new voltages received More...
 
 analog_value_changed
 (EventHandler) an event that fires with new value received More...
 
 adc_value_changed
 (EventHandler) an event that fires with new ADC value received More...
 
 adc_value_threshold
 (float) the threshold for adc_value_changed events More...
 
 analog_value_threshold
 (float) the threshold for analog_value_changed events More...
 
 analog_voltage_threshold
 (float) the threshold for analog_voltage_changed events More...
 

Properties

 adc_value = property
 Immediately returns the last ADC value (0-4095) captured from the pin. More...
 
 analog_voltage = property
 Immediately returns the last analog voltage (0.0 - 3.3V) captured from the pin. More...
 
 analog_value = property
 Immediately returns the uniform last analog value (0.0 - 1.0) captured from the pin. More...
 

Detailed Description

Represents an ADC pin.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   bit_depth,
  max_voltage 
)

Member Data Documentation

◆ adc_value_changed

adc_value_changed

(EventHandler) an event that fires with new ADC value received

◆ adc_value_threshold

adc_value_threshold

(float) the threshold for adc_value_changed events

◆ analog_value_changed

analog_value_changed

(EventHandler) an event that fires with new value received

◆ analog_value_threshold

analog_value_threshold

(float) the threshold for analog_value_changed events

◆ analog_voltage_changed

analog_voltage_changed

(EventHandler) an event that fires with new voltages received

◆ analog_voltage_threshold

analog_voltage_threshold

(float) the threshold for analog_voltage_changed events

◆ max_voltage

max_voltage

Property Documentation

◆ adc_value

adc_value = property
static

Immediately returns the last ADC value (0-4095) captured from the pin.

Returns
(int) the last ADC value

◆ analog_value

analog_value = property
static

Immediately returns the uniform last analog value (0.0 - 1.0) captured from the pin.

Returns
(float) the last analog value value

◆ analog_voltage

analog_voltage = property
static

Immediately returns the last analog voltage (0.0 - 3.3V) captured from the pin.

Returns
(float) the last analog voltage value

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