Skip to content

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Apr 5, 2021

The platform bundled SAMD_AnalogCorrection library is only compatible with 12 bit ADC resolution. This can be confusing to the user because:

  • The definition of ADC_RESOLUTION_BITS in the CorrectADCResponse sketch gives the impression this value can be modified by the user.
  • The default analogRead() resolution is 10 bits.

The first is resolved by the addition of a comment prohibiting changing the value of ADC_RESOLUTION_BITS.

The second is resolved by the addition of an analogReadResolution(12) call to the code generated by the CorrectADCResponse sketch.


Closes #608

CC: @hasenradball

The platform bundled SAMD_AnalogCorrection library is only compatible with 12 bit ADC resolution. This can be confusing to the user because:

- The definition of ADC_RESOLUTION_BITS in the CorrectADCResponse sketch gives the impression this value can be modified by the user.
- The default analogRead() resolution is 10 bits.

The first is resolved by the addition of a comment prohibiting changing the value of ADC_RESOLUTION_BITS.

The second is resolved by the addition of an `analogReadResolution(12)` call to the code generated by the CorrectADCResponse sketch.
@facchinm facchinm merged commit dda98e5 into arduino:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnalogReadCorrection gives wrong results if ADC resolution is 10bit

2 participants