-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add iteration support for touchpads #113
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
579cd86
Add IterableInput functionality
tekktrik c956842
Merge branch 'adafruit:main' into feature/iterable-io
tekktrik 6613a9f
Fix iteration
tekktrik 729d115
Remove checking type argument for IterableInput.__getitem__()
tekktrik 3e617ef
Fix how converting to string name works for IterableInput index
tekktrik 5681500
Only return list of pin names for IterableInput.touched
tekktrik c55b184
Change name of board.A7 to board.TX
tekktrik e63078e
Add IterableInput.touchpads to list all pins registered as touchpads
tekktrik 7349f09
Add and update docstring documentation
tekktrik ced6010
Remove IterableInput.__contains__()
tekktrik 9ed4aa4
Remove debug print statement
tekktrik 808c78a
Use combination of board.Pin and touchio.TouchIn, only initializing a…
tekktrik 19aaca1
Remove typing imports and type annotations
tekktrik 5b2cca9
Fix range()
tekktrik b965fdc
Remove spaces in line
tekktrik db59424
Linted and reformatted per pre-commit
tekktrik 64869b5
Update touch all example to use new IterableInput features
tekktrik 8d63f8e
Adding example use of all() to touch all example
tekktrik 78ff7fb
Add example for initializing and deinitializing touchpad inputs
tekktrik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-FileCopyrightText: 2021 Alec Delaney | ||
# SPDX-License-Identifier: MIT | ||
|
||
"""This example prints to the serial console when you touch the capacitive touch pads.""" | ||
from adafruit_circuitplayground import cp | ||
|
||
print("Here are all the initially registered touchpads:") | ||
print(cp.touchpads) | ||
|
||
print("You can remove a few if you need those pins:") | ||
cp.deinit_touchpad("A2") | ||
cp.deinit_touchpad("A5") | ||
print(cp.touchpads) | ||
|
||
print("You can also readd them later!") | ||
cp.init_touchpad("A2") | ||
print(cp.touchpads) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is no longer needed given my general comment, but note that
range(1, 7)
will allocate storage. Also, the upper limit is exclusive and is not included; it will only go from 1 to 6.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat, I didn't think about that, thanks!