[riot-users] Adc example for Esp32

Burak Karaduman bburakkaraduman at gmail.com
Wed Oct 16 22:59:13 CEST 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20191016/48ad393d/attachment.htm>


More information about the users mailing list