Skip to content
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

Add a function returning currently used analogRead resolution #563

Open
abetis opened this issue Jun 7, 2024 · 1 comment
Open

Add a function returning currently used analogRead resolution #563

abetis opened this issue Jun 7, 2024 · 1 comment

Comments

@abetis
Copy link

abetis commented Jun 7, 2024

I'm surprised there is no function in Arduino suite that returns ADC's resolution (in bits), or maximal value that cane be read from analogRead().

Having such function will allow writing a more cross-platform code that uses ADC.
For ATMega328 such function might be hard-coded to 10bit or 1023.
Other cores will return other hard-coded values or currently used ADC's resolution based on controller registers.

@Ferdinaelectro

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants