8000 Tuple for touch · Issue #12 · adafruit/Adafruit_CircuitPython_CircuitPlayground · GitHub
[go: up one dir, main page]

Skip to content

Tuple for touch #12

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

Closed
caternuson opened this issue Oct 19, 2017 · 2 comments
Closed

Tuple for touch #12

caternuson opened this issue Oct 19, 2017 · 2 comments

Comments

@caternuson
Copy link
Contributor
caternuson commented Oct 19, 2017

Consider having a function that returns a tuple of touched pads. Allows for iterating over all touched pads:

for pad in cpx.touched:
    print("pad {0} touched!".format(pad))

Also allows using the in syntax to check if a pad is touched. Can return ints:

if 1 in cpx.touched:
    print("pad 1 touched!")

or maybe strings:

if 'A1' in cpx.touched:
    print("pad A1 touched!")

or something else?

@kattni
Copy link
Contributor
kattni commented Oct 20, 2017

We had talked about this previously as well. The last example seems to be the most readable. This can definitely be included. Added to list.

@kattni
Copy link
Contributor
kattni commented Oct 24, 2017

The functions were designed but it was determined that they aren't a good fit for this library.

The function code and examples have been posted to the adafruit/circuitpython repo here adafruit/circuitpython#367 for future use. Discussed suggestions for future use are outlined in the issue.

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

No branches or pull requests

2 participants
0