From 34d37961c37be9048215466007b1e4c93f73440c Mon Sep 17 00:00:00 2001 From: Christian Ferbar <5595808+ferbar@users.noreply.github.com> Date: Sun, 28 Feb 2021 18:02:02 +0100 Subject: [PATCH] ADC fix: GPIO0 not usable as output if ADC_VCC is used (#1557) --- esphome/components/adc/adc_sensor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/adc/adc_sensor.cpp b/esphome/components/adc/adc_sensor.cpp index 9b1f452131..c6e2141725 100644 --- a/esphome/components/adc/adc_sensor.cpp +++ b/esphome/components/adc/adc_sensor.cpp @@ -16,7 +16,9 @@ void ADCSensor::set_attenuation(adc_attenuation_t attenuation) { this->attenuati void ADCSensor::setup() { ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str()); +#ifndef USE_ADC_SENSOR_VCC GPIOPin(this->pin_, INPUT).setup(); +#endif #ifdef ARDUINO_ARCH_ESP32 analogSetPinAttenuation(this->pin_, this->attenuation_);