analogRead returns 0 all the time

Hi all,

For a project I use a ESP32-WROOM32E (esp32dev / Arduino in PIO).

I upgraded to platform 6.0.0 (coming from 3.5.0) and now analogRead on 1 specific pin doesn’t work anymore…

ADC1_4 and ADC1_7 work fine, but ADC_6 returns always 0.

I already have tried another module, but the problem is the same.

Is there something changed in this newer version that requires a special initialization or something like that?

I can’t see why the other pins (also on ADC1) do still work.

Any help is welcome!

Thanks / best regards,


That’s a very large leap forward. The 3.5.0 platform was using Arduino-ESP32 1.0.6. Now with the latest platform version you’re on 2.0.6.

Does it also fail in the Arduino IDE with the latest 2.0.6 core? If yes, issue to Issues · espressif/arduino-esp32 · GitHub.

Thanks for your fast response (again) :sunglasses:

I have it working now.

I had to use:

 analogSetPinAttenuation(SHUNT, ADC_0db);   //SHUNT = IO34

Now the readings are between 40 and 600. That’s perfect for me.

Best regards,