7#ifdef USE_ADC_SENSOR_VCC
17static const char *
const TAG =
"adc.esp8266";
20#ifndef USE_ADC_SENSOR_VCC
26 LOG_SENSOR(
"",
"ADC Sensor",
this);
27#ifdef USE_ADC_SENSOR_VCC
28 ESP_LOGCONFIG(TAG,
" Pin: VCC");
30 LOG_PIN(
" Pin: ", this->
pin_);
36 LOG_UPDATE_INTERVAL(
this);
44#ifdef USE_ADC_SENSOR_VCC
53 return aggr.aggregate();
55 return aggr.aggregate() / 1024.0f;
ADC_MODE(ADC_VCC) namespace esphome
virtual uint8_t get_pin() const =0
float sample() override
Perform a single ADC sampling operation and return the measured value.
void setup() override
Set up the ADC sensor by initializing hardware and calibration parameters.
void dump_config() override
Output the configuration details of the ADC sensor for debugging purposes.
SamplingMode sampling_mode_
const LogString * sampling_mode_to_str(SamplingMode mode)
Providing packet encoding functions for exchanging data with a remote host.