-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adc.readvdd33() #2925
Comments
If the ESP8266 has been configured to use the ADC for sampling the external
pin, this function will always return 65535. This is a hardware and/or SDK
limitation.
https://nodemcu.readthedocs.io/en/latest/modules/adc/#adcreadvdd33
|
That's exactly the example in the documentation. So this is a software or documentation bug. |
According to our documentation (and the code) |
For
calling it with no argument yields the same result. But for
it returns 3015 which is what I would expect |
Doing a quick |
Hhm, that's what If the test script keeps rebooting the device it means that |
|
Oops. Definitely bug. I missed adc.c:L132. The Phy Data sector is no longer at END-4. We need to read its address from the PT
|
I have fixed this in my working directory and will add this fix to my #2912 next commit. |
Please clarify this: adc.readvdd33(0) returns system voltage in milivolts, but adc.read(0) returns what? |
adc.read(0) returns what?
Voltage on ADC pin in milivolts or direct convertion resulst in range of
0-1024?
Both are the same. That's because adc measures only up to 1000 millivolts.
|
Are You siure?
|
@Michal78S The ESP8266 ADC has inherent stability issues as a result of an internal hardware design flaw. You may find some of 2864 and esp8266/Arduino:2070 relevant. |
There are two examples in the doc https://nodemcu.readthedocs.io/en/master/modules/adc/ Anyway both doesn't work in the branch master. @TerryE: how can i checkout your fix of the bug? I guess there are no change in adc.c module. |
@rptnscz maybe this one 32e161b#diff-1925935f8d24083ba3e86383f92b7ea8 It's a bit unfortunate that many fixes went into that branch (rather than dev) but that's just how it is. Please be patient. |
Fixed in #3075 |
adc.readvd33() not working....
in my init.lua have:
but
=adc.readvdd33()
=adc.readvdd33()
65535
The text was updated successfully, but these errors were encountered: