Skip to content

Add per channel property style access #9

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 5 commits into from
Sep 21, 2018
Merged

Conversation

caternuson
Copy link
Contributor

A nominal "fix" for #1. Adds per channel property style access to value and raw_value for each channel:

mpr121[0].value
mpr121[0].raw_value

@caternuson caternuson requested a review from a team September 20, 2018 01:15
@caternuson
Copy link
Contributor Author

NOTE I also added touched_pins to return a tuple of all pin states. Useful?

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Two small comments

self.reset()

def __getitem__(self, key):
if key < 0 or key > 11:
raise ValueError('Pin must be a value 0-11.')
Copy link
Member

Choose a reason for hiding this comment

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

Use IndexError please. It's what [] usually responds with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. that was copy pasta :(

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Ok great! Thanks!

@tannewt tannewt merged commit 07ffe38 into adafruit:master Sep 21, 2018
@caternuson caternuson deleted the iss1 branch September 21, 2018 21:03
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 23, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 1.2.0 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPR121#9 from caternuson/iss1
  > ignore the board module imports in .pylintrc
@caternuson caternuson mentioned this pull request Sep 24, 2018
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