Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Bug fix: signed differential sample values are ignored in ADS1015 (12 bi... #115

Merged
merged 1 commit into from
Apr 1, 2015

Conversation

omryn
Copy link
Contributor

@omryn omryn commented Apr 1, 2015

When using ADS1015, ADS1x15.readADCDifferential method ignores signed inputs,
So positive samples make sense, but negative samples are returned as high values. This is especially frustrating in samples that oscillate around 0mV.
The fix is checking the most significant bit (11) and subtract the max value (0xFFF) from the signed sample if necessary, much like the 16 bit version.
Enjoy

ladyada added a commit that referenced this pull request Apr 1, 2015
Bug fix: signed differential sample values are ignored in ADS1015 (12 bi...
@ladyada ladyada merged commit 5ca6809 into adafruit:master Apr 1, 2015
@ladyada
Copy link
Member

ladyada commented Apr 1, 2015

thx!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants