adafruit / Adafruit_Python_ADS1x15

Python code to use the ADS1015 and ADS1115 analog to digital converters with a Raspberry Pi or BeagleBone black.
MIT License
119 stars 134 forks source link

Single Ended Input Example & README Update #7

Closed jonathanrjpereira closed 5 years ago

jonathanrjpereira commented 6 years ago

The changes are supported in Python 2.7 & 3. They have been tested on a Raspberry Pi 3.

Single Ended Input Example The original examples considered a 16-bit resolution for Single Ended Inputs. But according to the datasheet, 16-bit resolution applies only to Differential inputs whereas a 15-bit resolution applies to the Single Ended Inputs. I made an example which takes this into consideration and also calculates & prints the value of the Input Analog Voltage.

README Update When I began using this library, I had various doubts regarding the Analog Input Voltage constraints, The differences between Single Ended & Differential Inputs and Calculation of Input Analog Voltage.

  1. I discussed the relationship between the Power Supply voltage which determines the Maximum Analog Input Voltage with an example.
  2. I defined the bit resolutions of Single and Differential Inputs & also their pin configurations.
  3. Provided a detailed explanation, formulas & reference tables to calculate the Input Analog Voltage for Single Ended Input.
caternuson commented 5 years ago

Thank you for the PR! However, we're moving to a new library. We're going to be deprecating this library in favor of this one: https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15

Please take a look at that one and see if this PR still applies.

That library is available on PyPI for you to pip3 install adafruit-circuitpython-charlcd and use on Raspberry Pi thanks to the Adafruit-Blinka library which should install automatically along with the other dependencies needed for using charlcd. Please see the documentation for API and usage examples. There are Raspberry Pi-specific examples in the examples/ folder in the repo.