esphome-docs/api/sensor/adc-sensor.rst

32 lines
684 B
ReStructuredText

ADC Sensor
==========
Example Usage
-------------
.. code-block:: cpp
// Basic
App.make_adc_sensor("Analog Voltage", 13);
// Custom update interval 30 seconds
App.make_adc_sensor("Analog Voltage", 13, 30000);
// Custom pinMode
App.make_adc_sensor("Analog Voltage", GPIOInputPin(13, INPUT_PULLUP));
// ESP32: Attenuation
auto adc = App.make_adc_sensor("Analog Voltage", 13);
adc.adc.set_attenuation(ADC_11db);
.. cpp:namespace:: nullptr
See :cpp:func:`Application::make_adc_sensor`.
API Reference
-------------
.. cpp:namespace:: nullptr
.. doxygenclass:: sensor::ADCSensorComponent
:members:
:protected-members:
:undoc-members: