Adc example for Esp32

Hi all,

I have following code

adc_t g4= GPIO4; void main(){ adc_init(g4);

while(1){ printf(“Value=%d”,adc_sample(g4,ADC_RES_12BIT);

} } My question is what is the step that i missed. It always prompt 4095 to screen. In my hardware design i made a voltage divider circuit with a 4.7k and a LDR. I measured ldr and it was 2.7 volts when sample results was 4095. Could someone satisfy an example or try to run my code in another device?

Is there an example for ADC in Riotos

https://github.com/RIOT-OS/RIOT/tree/master/tests/periph_adc

Thanks Peter. I have solved it with Gunar. There was also a issue about Adc Channels of Esp32. Thanks for your reply.

10 Ara 2019 Sal 13:59 tarihinde Peter Kietzmann <peter.kietzmann@haw-hamburg.de> şunu yazdı: