7 #ifdef USE_ADC_SENSOR_VCC 12 #endif // USE_ADC_SENSOR_VCC 17 static 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_);
32 #endif // USE_ADC_SENSOR_VCC 34 LOG_UPDATE_INTERVAL(
this);
40 #ifdef USE_ADC_SENSOR_VCC 44 #endif // USE_ADC_SENSOR_VCC 46 raw = (raw + (this->sample_count_ >> 1)) / this->
sample_count_;
void setup() override
Setup ADC.
virtual uint8_t get_pin() const =0
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.
std::string unique_id() override
Implementation of SPI Controller mode.
void dump_config() override
ADC_MODE(ADC_VCC) namespace esphome
const StringRef & get_name() const