9#include <esp_adc_cal.h>
10#include "driver/adc.h"
18#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 7)) || \
19 (ESP_IDF_VERSION_MAJOR == 5 && \
20 ((ESP_IDF_VERSION_MINOR == 0 && ESP_IDF_VERSION_PATCH >= 5) || \
21 (ESP_IDF_VERSION_MINOR == 1 && ESP_IDF_VERSION_PATCH >= 3) || \
22 (ESP_IDF_VERSION_MINOR >= 2)) \
25static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_12;
27static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_11;
65 void setup()
override;
98#if ESP_IDF_VERSION_MAJOR >= 5
BedjetMode mode
BedJet operating mode.
This class simplifies creating components that periodically check a state.
void set_sampling_mode(SamplingMode sampling_mode)
std::string unique_id() override
void set_autorange(bool autorange)
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM]
void set_sample_count(uint8_t sample_count)
void set_pin(InternalGPIOPin *pin)
void set_attenuation(adc_atten_t attenuation)
Set the attenuation for this pin. Only available on the ESP32.
void setup() override
Setup ADC.
void set_channel1(adc1_channel_t channel)
void set_channel2(adc2_channel_t channel)
void dump_config() override
void set_is_temperature()
void update() override
Update ADC values.
SamplingMode sampling_mode_
float get_setup_priority() const override
HARDWARE_LATE setup priority
void set_output_raw(bool output_raw)
void add_sample(uint32_t value)
Aggregator(SamplingMode mode)
Base-class for all sensors.
Abstract interface for components to request voltage (usually ADC readings)
const LogString * sampling_mode_to_str(SamplingMode mode)
Providing packet encoding functions for exchanging data with a remote host.