7#ifdef USE_ADC_SENSOR_VCC
17static const char *
const TAG =
"adc.esp8266";
20 ESP_LOGCONFIG(TAG,
"Setting up ADC '%s'...", this->
get_name().c_str());
21#ifndef USE_ADC_SENSOR_VCC
27 LOG_SENSOR(
"",
"ADC Sensor",
this);
28#ifdef USE_ADC_SENSOR_VCC
29 ESP_LOGCONFIG(TAG,
" Pin: VCC");
31 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;
ADC_MODE(ADC_VCC) namespace esphome
const StringRef & get_name() const
virtual uint8_t get_pin() const =0
std::string unique_id() override
void setup() override
Setup ADC.
void dump_config() override
SamplingMode sampling_mode_
const LogString * sampling_mode_to_str(SamplingMode mode)
Providing packet encoding functions for exchanging data with a remote host.
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.