10 #include <esp_adc_cal.h> 11 #include "driver/adc.h" 19 #if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 7)) || \ 20 (ESP_IDF_VERSION_MAJOR == 5 && \ 21 ((ESP_IDF_VERSION_MINOR == 0 && ESP_IDF_VERSION_PATCH >= 5) || \ 22 (ESP_IDF_VERSION_MINOR == 1 && ESP_IDF_VERSION_PATCH >= 3) || \ 23 (ESP_IDF_VERSION_MINOR >= 2)) \ 26 static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_12;
28 static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_11;
51 void setup()
override;
82 #if ESP_IDF_VERSION_MAJOR >= 5 85 esp_adc_cal_characteristics_t cal_characteristics_[ADC_ATTEN_MAX] = {};
Abstract interface for components to request voltage (usually ADC readings)
This class simplifies creating components that periodically check a state.
void set_channel2(adc2_channel_t channel)
void set_channel1(adc1_channel_t channel)
void setup() override
Setup ADC.
void set_is_temperature()
void set_sample_count(uint8_t sample_count)
void set_output_raw(bool output_raw)
void set_attenuation(adc_atten_t attenuation)
Set the attenuation for this pin. Only available on the ESP32.
std::string unique_id() override
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM]
void update() override
Update ADC values.
Implementation of SPI Controller mode.
void set_autorange(bool autorange)
void set_pin(InternalGPIOPin *pin)
Base-class for all sensors.
float get_setup_priority() const override
HARDWARE_LATE setup priority
void dump_config() override