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
[ESP32] Read from ADC2 Pins #6219
Comments
Please raise this in the forum rather than in the MicroPython bug tracker. |
Okay thanks |
Is there a reason machine_adc only exposes ADC 1? I understand most uses case will have WiFi running however there are times when this isn't the case so what is the reason for not having them accessible? It seems a little restrictive to me. |
FYI: There is a workaround for getting ADC2 values whilst WiFi is running. |
This is simply not implemented (mainly because with WiFi enabled it's not possible to use ADC2). Also there's currently no standard way to select an ADC peripheral to use for a given pin, but in this case I think it could just automatically select ADC2 if a pin was given that only supported ADC on ADC2. Summary: it can be implemented, feel free to make a PR for it. |
Rework the ADC implementation to use the micropython#4213 API (mostly) adding support for calibrated voltage readings and the ADC2 block. Resolves micropython#6219. Part-resolves micropython#3943.
Rework the ADC implementation to use the micropython#4213 API (mostly) adding support for calibrated voltage readings and the ADC2 block. Resolves micropython#6219. Part-resolves micropython#3943.
Rework the ADC implementation to use the micropython#4213 API (mostly) adding support for calibrated voltage readings and the ADC2 block. Resolves micropython#6219. Part-resolves micropython#3943.
Rework the ADC implementation to use the micropython#4213 API (mostly) adding support for calibrated voltage readings and the ADC2 block. Resolves micropython#6219. Part-resolves micropython#3943.
Support for ADC2 was implemented in 63438a3 |
But, do I have to disable Wifi to use it? |
I'm not sure, you'll need to read the ESP datasheet, or just try it out. |
Rework the ADC implementation to follow the improved ADC/ADCBlock API. This adds support for calibrated voltage readings and the ADC2 block. The ADC API is backwards compatible with what it was before this change. Resolves micropython#6219.
Is there any way of accessing ADC2 Pins?
Even with WiFi off you cannot set up an ADC on any of the ADC2 Pins as you get the error
ValueError: invalid Pin for ADC
Looking at the esp32 port for machine_adc.c it seems only adc1 pins are supported. Is there any way to use ADC2?
The text was updated successfully, but these errors were encountered: