adafruit / Adafruit_CircuitPython_ADS1x15

CircuitPython drivers for the ADS1x15 series of ADCs.
MIT License
140 stars 59 forks source link

Interface change for #17 #19

Closed caternuson closed 5 years ago

caternuson commented 5 years ago

NOTE - This is a huge API breaking complete rewrite of this library.

Anywho, it now works like the MCP3xxx lib and fixes #17. Single-Ended:

Adafruit CircuitPython 3.1.1 on 2018-11-02; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, busio
>>> import adafruit_ads1x15.ads1115 as ADS
>>> from adafruit_ads1x15.analog_in import AnalogIn
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> ads = ADS.ADS1115(i2c)
>>> chan = AnalogIn(ads, ADS.P0)
>>> chan.value
14084
>>> chan.voltage
1.76055
>>>

Differential:

Adafruit CircuitPython 3.1.1 on 2018-11-02; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, busio
>>> import adafruit_ads1x15.ads1115 as ADS
>>> from adafruit_ads1x15.analog_in import AnalogIn
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> ads = ADS.ADS1115(i2c)
>>> chan = AnalogIn(ads, ADS.P0, ADS.P1)
>>> chan.value
10565
>>> chan.voltage
1.32091
>>>
sommersoft commented 5 years ago

Forgot to check this last night during review. With this change, the following Learn Guide will need to be updated: https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/python-circuitpython

Also, not sure of the CPython library status, but this one may need a look as well: https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/overview

tagging: @kattni, @brennen

sommersoft commented 5 years ago

@kattni, I'll leave this for you to merge, since there is at least one Learn Guide update as noted above.

caternuson commented 5 years ago

@kattni ping

kattni commented 5 years ago

@caternuson Would you be able to update the guide?

caternuson commented 5 years ago

Sure. That first guide linked should get updated. Can you ask if that second one should maybe get deprecated?

kattni commented 5 years ago

@caternuson Yep, looking into it. I'll let you know what I find out.

kattni commented 5 years ago

Merging this. Carter is going to be updating the guides.

kattni commented 5 years ago

@caternuson We're going to deprecate the second guide.

caternuson commented 5 years ago

Thanks. Will update the other one.

ladyada commented 5 years ago

we'll also archive https://github.com/adafruit/Adafruit_Python_ADS1x15 @caternuson wanna look at the PR's and issues, see if anything is relatable?

caternuson commented 5 years ago

@ladyada checked. nothing relatable. added more info here: https://github.com/adafruit/Adafruit_Python_ADS1x15/issues/13

ladyada commented 5 years ago

yep! @kattni can show you how to close all the issues, PRs, update the README and then Archive the repo