-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix #362: ADC voltage conversion might be incorrect #397
Conversation
fdb5711
to
9f4d8d7
Compare
Maybe add some description about convertion rules in |
Ok, will do that |
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.
Thanks!
This makes the Debug::fmt()
output a bit confusing as now that max_sample
is exclusive. But it says nowhere that max_sample
must be inclusive so I'm absolutely fine with it. Maybe a small comment in on the struct field would help though.
@jordens Sorry, I don't understand the comment about Debug::fmt(), this PR doesn't change anything there. Sure you commented on the right PR? |
The PR does affects the string that it printed. It would now say e.g. |
Thanks, now I get it. Since docs are an open task, I'll consider that.
|
dc5b856
to
d9a9cd2
Compare
bors r+ |
since the discussion in #362 seems to come to a conclusion, and my personal measurements supported that, I think it's time to actually fix it.
This will change max_sample from 1<<n-1 to 1<<n,
After this PR ADC readings will change, but will be more accurate than before. Users might be confused since they won't get a reading of 3300mV, but this is correct behaviour.