-
Notifications
You must be signed in to change notification settings - Fork 88
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
Correcting ADMUX selection in __analogRead() #130
Conversation
LaZsolt
commented
Apr 2, 2021
- ADMUX input source used a wrong mask. (was 0x0f instead 0x1f)
- LGT8F328D ADMUX has less input than P version. If someone want to read these unselectable inputs, it will return zero ADC value.
- V5D1 and VCCM is same input with different name
- ADMUX input source used a wrong mask. (was 0x0f instead 0x1f) - LGT8F328D ADMUX has less input than P version. If someone want to read these unselectable inputs, it will return zero ADC value. - V5D1 and VCCM is same input with different name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set default analogReadResolution to 10 bits.
#41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary round bracket deleted.
is this why I'm getting 12bit default adc on projects |
Hey @LaZsolt ! |
Yes, but as @jayzakk mentioned in #41 the aduino default is 10 bits for backward compatibility with AVR based boards. I think not necessary any example sketch, because it is a normal Arduino analog API extended function for those boards which have 12 bits ADC. It may be unpleasant for those users who will be upgrading dbuezas/lgt8fx core. |
Gotcha. I'll make a release without, and then merge this one and move to v2 following semver |
But this request is not mainly about AnalogReadResolution. In this line below, because of the bitmask of lgt8fx/lgt8f/cores/lgt8f/wiring_analog.c Line 147 in 97e273a
With my correction more inputs will be readable: PIN_A8, PIN_A9, PIN_A10, PIN_A11, IVREF, AGND, DACO, 1/5 AVCC, 4/5 AVCC |
Oh, so this is not breaking change then. Should i merge now? |
This pull request is two in one.
I think it's acceptable. If you think the same then you should merge it. |
Oh got it. Then Ill hold it a bit and very soon make 2 releases. The first without and the second with (and that will be v2.0.0) |
So this is the problem says why my A8 pin of wavgat board reject at build ? 'A8' was not declared in this scope |
@navr32 |
Hi LaZolt ! |
Close this request, because #217 include the solution. |