-->
Page 2 of 2

Re: system_adc_read_fast() always give 1024 as output

PostPosted: Sat Jan 13, 2018 10:04 am
by martinayotte
That is probably because it is reading the VCC not the A0.

Quote from https://github.com/nodemcu/nodemcu-firm ... les/adc.md

Depending on the setting in the "esp init data" (byte 107) one can either use the ADC to read an external voltage, or to read the system voltage (vdd33), but not both.


In ArduinoESP framework, we simply have to add globally the command "ADC_MODE(ADC_TOUT)".

Re: system_adc_read_fast() always give 1024 as output

PostPosted: Sun Jan 14, 2018 12:57 am
by yourbro
Adding "ADC_MODE(ADC_TOUT);" at the top of sketch doesn't help.

system_adc_read_fast() still always returns 1024. And, system_adc_read() continues to return correct values as before.

Might there be a fault in the implementation of system_adc_read_fast() in the ESP8266_NONOS_SDK?

Re: system_adc_read_fast() always give 1024 as output

PostPosted: Sun Jan 14, 2018 8:27 am
by schufti
Easiest way to check: switch to older core based on older sdk.