Page 1 of 1

ESP-WROM-02 Read from TOUT ADC

Posted: Wed May 15, 2019 9:52 am
by EsPmIcRoY
Hi,

I have a ESP-WROM-02 and I would read a ADC signal.

On the datasheat I read that it is possible only read from the TOUT pin!
I found an example in C language that use "system_adc_read" function.

On micropython for read from an ADC input I use "machine.ADC(<IO>)" but in this case I don't know the name (or number) for the TOUT pin.

Does anyone know how I can do it?

Thank you

Re: ESP-WROM-02 Read from TOUT ADC

Posted: Wed May 15, 2019 10:19 am
by jimmo
Hi,

machine.ADC takes a channel number, not a pin. On ESP8266, channel 0 is the ADC pin, channel 1 is VDD33.

https://docs.micropython.org/en/latest/ ... l/adc.html

Re: ESP-WROM-02 Read from TOUT ADC

Posted: Thu May 16, 2019 9:49 am
by EsPmIcRoY
Hi jimmo,

I tried with ADC(0) and work fine!

I just have to be careful because this input only accepts values ranging from 0v to 1v!

Thank you

Re: ESP-WROM-02 Read from TOUT ADC

Posted: Thu May 16, 2019 10:07 am
by jimmo
Yup. As the doc says though, a pair of resistors (in a voltage divider) will let you use anything you want.