Page 1 of 1

esp32 questing

Posted: Tue Nov 07, 2023 5:45 am
by huangyuzhe
I am using the arduino ide environment to develop esp32 wroom32u, and now I am encountering the following problem: I plan to use the io14 port to check the battery level, but using analogread() to read the result is 0, and using digitalread() to read the result is 1. My overall code uses WiFi function and uses udp communication to send data to the computer. According to existing information, using the WiFi function can cause the resources of ADC2 to be occupied by the WiFi function. Therefore, I switched to reading the IO port data of ADC1, but the results were still the same, with an analog input of 0 and a digital input of 1. Could you please help me see what the problem may be

Re: esp32 questing

Posted: Thu Nov 09, 2023 2:12 am
by thezcx
Gpio14 is adc2 i guess and also strapping pin. Use one of these
ADC1_CH0 (GPIO 36)
ADC1_CH1 (GPIO 37)
ADC1_CH2 (GPIO 38)
ADC1_CH3 (GPIO 39)
ADC1_CH4 (GPIO 32)
ADC1_CH5 (GPIO 33)
ADC1_CH6 (GPIO 34)
ADC1_CH7 (GPIO 35)