Skip to content

Move Mode consts into an enum like class. #25

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 1 commit into from
Feb 6, 2019
Merged

Move Mode consts into an enum like class. #25

merged 1 commit into from
Feb 6, 2019

Conversation

caternuson
Copy link
Contributor

For #21.

NOTE Continuous doesn't actually work right now. Probably need to change the wait-for-conversion-complete behavior. Suggest covering that in a separate issue.

Adafruit CircuitPython 3.1.2 on 2019-01-07; 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
2388
>>> ads.mode
256
>>> ads.mode = ADS.Mode.CONTINUOUS
>>> ads.mode
0
>>> ads.mode = ADS.Mode.SINGLE
>>> ads.mode
256
>>> chan.value
2388
>>> 

@caternuson caternuson requested a review from a team February 5, 2019 23:56
Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Code looks good. I don't have the hardware to test it on though.

@makermelissa makermelissa merged commit 5ba760c into adafruit:master Feb 6, 2019
@caternuson caternuson deleted the iss21_consts branch February 6, 2019 00:34
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 6, 2019
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.

2 participants