ADC Pin Element
The ADC pin element is used to read the voltage of an ADC pin.
The ADC pin element is located in the Element Toolbox within Studio’s Embedded tab.
Properties
The following properties can be changed for the ADC pin element:
Name
The name of the element.
Instance
The ADC driver instance number to use. If unsure, leave it set to the default value.
ADC Pin
The device’s ADC pin the element is connected to.
Number of Samples
The number of samples the ADC driver takes an average from before returning a value.
Timeout
The length of time to block execution while awaiting a return value from the ADC pin.
Triggers
The following triggers are available to execute events from within the ADC pin element:
Triggered
Execute an event when the source element connected to the ADC pin triggers.
Raw Read
Execute an event when raw ADC pin data is read.
Voltage Read
Execute an event when the pin’s voltage is read.
Reference Voltage Read
Execute an event when the ADC reference voltage is read.
Abilities
The following abilities are available for the ADC pin element when its source element triggers:
Trigger
Trigger the element(s) that follow the ADC pin element.
Read Raw
Read the pin’s raw data.
Read Voltage
Read the pin’s voltage in millivolts.
Read Reference Voltage
Read the ADC reference voltage in millivolts.
Element Resources
Atmosphere includes a selection of resources for users of all levels that demonstrate using the ADC pin element.
Demo Projects
To view the ADC pin element used within a project, click the demo’s name to open the project in Atmosphere and see how the element is set up.
Name | Hardware | Description |
---|---|---|
ADC Pin Arduino Demo | Arduino Mega | The ADC pin element is used within this demo project by reading the voltage from the analog pin and printing it on the debug console. |
ADC Pin ESP32 Demo | HUZZAH32 | The ADC pin element is used within this demo project by reading the voltage from the analog pin and sending the data to the cloud. |
ADC Pin nRF Demo | nRF52840-DK | The ADC pin element is used within this demo project by reading the voltage from the analog pin and printing it on the debug console. |