Skip to content

Interface change for #17 #19

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

Merged
merged 6 commits into from
Dec 3, 2018
Merged

Interface change for #17 #19

merged 6 commits into from
Dec 3, 2018

Conversation

caternuson
Copy link
Contributor

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
>>>

@caternuson caternuson requested a review from a team November 9, 2018 21:51
Copy link
Collaborator

@sommersoft sommersoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooray for standard usage among friends! 🎉

Couple questions. Looks good!

note: I don't have hardware to test

@sommersoft
Copy link
Collaborator

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


@mode.setter
def mode(self, mode):
if mode != _ADS1X15_CONFIG_MODE_CONTINUOUS or mode != _ADS1X15_CONFIG_MODE_SINGLE:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change or to and

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I zoomed straight past that one. Even scrolled up and checked that those were the only options. ✈️

@sommersoft
Copy link
Collaborator

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

@caternuson
Copy link
Contributor Author

@kattni ping

@kattni
Copy link
Contributor

kattni commented Nov 29, 2018

@caternuson Would you be able to update the guide?

@caternuson
Copy link
Contributor Author

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

@kattni
Copy link
Contributor

kattni commented Nov 29, 2018

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

@kattni
Copy link
Contributor

kattni commented Dec 3, 2018

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

@kattni kattni merged commit 2e61b96 into adafruit:master Dec 3, 2018
@kattni
Copy link
Contributor

kattni commented Dec 3, 2018

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

@caternuson
Copy link
Contributor Author

Thanks. Will update the other one.

@ladyada
Copy link
Member

ladyada commented Dec 3, 2018

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
Copy link
Contributor Author

@ladyada checked. nothing relatable. added more info here:
adafruit/Adafruit_Python_ADS1x15#13

@ladyada
Copy link
Member

ladyada commented Dec 3, 2018

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

tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 4, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 1.0.0 from 0.5.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#19 from caternuson/iss17_update

Updating https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BluefruitSPI#7 from adafruit/tannewt-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.2.1 from 2.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME280#18 from robert-hh/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.0.3 from 3.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#23 from adafruit/pypi-readme

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.1.2 from 2.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#13 from adafruit/lowercase_module_name

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.2.0 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#8 from ArthurDent62/chain_TLCs

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 1.3.3 from 1.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#20 from adafruit/pypi-readme
@caternuson caternuson deleted the iss17_update branch February 2, 2019 00:18
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

Successfully merging this pull request may close these issues.

Update interface.
4 participants