esp32 questing

huangyuzhe
Posts: 1
Joined: Tue Nov 07, 2023 5:43 am

esp32 questing

Postby huangyuzhe » Tue Nov 07, 2023 5:45 am

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

User avatar
thezcx
Posts: 16
Joined: Mon May 01, 2023 12:21 am

Re: esp32 questing

Postby thezcx » Thu Nov 09, 2023 2:12 am

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)

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 276 guests