Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: Correct ADC default resolution statement for ESP32-S2#11653

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
me-no-dev merged 3 commits intoespressif:masterfromeMUQI:patch-1
Aug 5, 2025

Conversation

@eMUQI
Copy link
Contributor

Description of Change

This PR corrects thedocumentation for analogReadResolution by removing an incorrect statement that the ESP32-S3 default ADC resolution is 13 bits.

As confirmed by the function's own documentation in the core header fileesp32-hal-adc.h, the default resolution for analogRead is 12 bits (producing a range of 0-4095).

Tests scenarios

Compiled and run on Seeed Studio XIAO ESP32S3 in version v3.3.0. By running the standard AnalogReadSerial example code, confirmed that the default output range is 0-4095, corresponding to 12-bit resolution.

Related links

https://docs.espressif.com/projects/arduino-esp32/en/latest/api/adc.html#analogreadresolution

/*
* Set the resolution of analogRead return values. Default is 12 bits (range from 0 to 4096).
* If between 9 and 12, it will equal the set hardware resolution, else value will be shifted.
* Range is 1 - 16
*
* Note: compatibility with Arduino SAM
*/
voidanalogReadResolution(uint8_tbits);

https://github.com/espressif/esp-idf/blob/346870a3044010f2018be0ef3b86ba650251c655/components/soc/esp32s3/include/soc/soc_caps.h#L129-L130

@github-actions
Copy link
Contributor

github-actionsbot commentedJul 27, 2025
edited
Loading

Messages
📖🎉 Good Job! All checks are passing!

👋Hello eMUQI, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by thePR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with eachpush event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manuallyretry these Danger checks, please navigate to theActions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫dangerJS againstb9c0f68

Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi@eMUQI, I have checked the code and you are right about the S3. The documentation should say that for S2! Can you please instead of removing it change the S3 to S2? Thanks

@P-R-O-C-H-YP-R-O-C-H-Y added the Type: DocumentationIssue pertains to Documentation of Arduino ESP32 labelJul 28, 2025
@eMUQIeMUQI changed the titledocs: Remove incorrect statement on ESP32-S3 default resolutiondocs: Correct ADC default resolution statement for ESP32-S2Jul 28, 2025
@eMUQI
Copy link
ContributorAuthor

Hi@P-R-O-C-H-Y , thanks for the review and clarification!
I've updated the PR as you suggested. Could you please take another look?

Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@P-R-O-C-H-YP-R-O-C-H-Y added the Status: Pending MergePull Request is ready to be merged labelJul 28, 2025
^^^^^^^^^^^^^^^^^^^^

This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095).
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is only for the chip revision v0.0. For v1.0, the resolution is 12 bits.

Please add a reference to theADC-112 Bit 1 of SAR ADC Does Not Flip errata.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi@eMUQI, can you take a look?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hi@pedrominatel,
Thanks for the clarification. Just to make sure I understand correctly:
The documentation should specify that the 13-bit default resolution only applies to ESP32-S2 chip revision v0.0, and I should also add a reference to theADC-112 Bit 1 of SAR ADC Does Not Flip errata.
Is that correct? If so, I will update the PR accordingly.
Thanks!

pedrominatel reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That's right.

@lucasssvazlucasssvaz removed the Status: Pending MergePull Request is ready to be merged labelJul 28, 2025
@eMUQI
Copy link
ContributorAuthor

@pedrominatel I've pushed the requested changes. PTAL when you have a moment. Thanks!

image
pedrominatel reacted with thumbs up emoji

@pedrominatelpedrominatel added the Status: Pending MergePull Request is ready to be merged labelJul 31, 2025
@me-no-devme-no-dev merged commitd26d7a3 intoespressif:masterAug 5, 2025
12 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pedrominatelpedrominatelpedrominatel approved these changes

@P-R-O-C-H-YP-R-O-C-H-YP-R-O-C-H-Y approved these changes

Assignees

No one assigned

Labels

Status: Pending MergePull Request is ready to be mergedType: DocumentationIssue pertains to Documentation of Arduino ESP32

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@eMUQI@pedrominatel@P-R-O-C-H-Y@me-no-dev@lucasssvaz

[8]ページ先頭

©2009-2025 Movatter.jp