7#ifdef USE_ADC_SENSOR_VCC
16static const char *
const TAG =
"adc.esp8266";
19#ifndef USE_ADC_SENSOR_VCC
25 LOG_SENSOR(
"",
"ADC Sensor",
this);
26#ifdef USE_ADC_SENSOR_VCC
27 ESP_LOGCONFIG(TAG,
" Pin: VCC");
29 LOG_PIN(
" Pin: ", this->
pin_);
35 LOG_UPDATE_INTERVAL(
this);
43#ifdef USE_ADC_SENSOR_VCC
52 return aggr.aggregate();
54 return aggr.aggregate() / 1024.0f;
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)