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

readSingle() overflows at 32768 #33

Closed
pabloxid opened this issue Jun 17, 2018 · 1 comment
Closed

readSingle() overflows at 32768 #33

pabloxid opened this issue Jun 17, 2018 · 1 comment

Comments

@pabloxid
Copy link

I have to use this way to get the correct value:

int val = (uint16_t)adc.readSingle();

@pedvide
Copy link
Owner

pedvide commented Dec 24, 2019

This is expected behavior, readSingle and similar methods return negative values for differential measurements. If you're measuring in single-ended mode you need to cast to uint16_t (this is also in the documentation).

@pedvide pedvide closed this as completed Dec 24, 2019
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

No branches or pull requests

2 participants