-
Notifications
You must be signed in to change notification settings - Fork 60
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
adafruit_ads1x15.Analogin - correct ADC scaling to 16-bit range to match analogio.AnalogIn #43 #92
Comments
There's also a question here about the unsigned nature of the values. Users of analogio.AnalogIn are accumstomed to the 16 bit unsigned range between 0-65535. I've only just started reading about the TI ADS in detail but they appear to effectively be 15bit ADCs (ignoring noise) when making single ended measurements? The values align with this and the code does too
The |
And for single-ended use there's a question here as to whether a floor of 0 should be applied to the values as the ADS1115 can return negative value when measuring 0V. I've experienced this myself. Unexpected negative values can cause havoc. I don't know the origins of it but, for comparison, I noticed the nRF52 code has this in AnalogIn
|
I think maybe this was resolved in: #98 although it wasn't the primary purpose of that PR. There is now code here: Adafruit_CircuitPython_ADS1x15/adafruit_ads1x15/analog_in.py Lines 73 to 74 in a40a311
and here: Adafruit_CircuitPython_ADS1x15/adafruit_ads1x15/analog_in.py Lines 82 to 84 in a40a311
Which seems to handle this if I am understanding correctly. @kevinjwalters can you confirm whether these bits of code are resolving the original issue documented here? |
The change in adafruit/circuitpython#4794 (raised by @PaintYourDragon) which appeared in CircuitPython 8 scales values to the full 16 bit range for
analogio.AnalogIn
.The current implementation of analog_in.AnalogIn has the old behaviour for the ADS1015 of zero padding to signed 16bit for the 12bit values.
This is part of the same ecosystem, should this be brought into line with the aforementioned full-scaling change? Same issue raised in adafruit/Adafruit_CircuitPython_MCP3xxx#43
The text was updated successfully, but these errors were encountered: