Skip to content

Commit b678678

Browse files
committed
Swap to LED for pin exclusion.
1 parent dfd784c commit b678678

3 files changed

Lines changed: 23 additions & 6 deletions

File tree

CircuitPython_Templates/audio_find_pins/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_unique_pins():
3131
"DOTSTAR_DATA",
3232
"APA102_SCK",
3333
"APA102_MOSI",
34-
"L",
34+
"LED",
3535
"SWITCH",
3636
"BUTTON",
3737
]

CircuitPython_Templates/i2c_find_pins/code.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,27 @@ def is_hardware_i2c(scl, sda):
1616

1717

1818
def get_unique_pins():
19-
exclude = ['NEOPIXEL', 'APA102_MOSI', 'APA102_SCK']
20-
pins = [pin for pin in [
21-
getattr(board, p) for p in dir(board) if p not in exclude]
22-
if isinstance(pin, Pin)]
19+
exclude = [
20+
getattr(board, p)
21+
for p in [
22+
# This is not an exhaustive list of unexposed pins. Your results
23+
# may include other pins that you cannot easily connect to.
24+
"NEOPIXEL",
25+
"DOTSTAR_CLOCK",
26+
"DOTSTAR_DATA",
27+
"APA102_SCK",
28+
"APA102_MOSI",
29+
"LED",
30+
"SWITCH",
31+
"BUTTON",
32+
]
33+
if p in dir(board)
34+
]
35+
pins = [
36+
pin
37+
for pin in [getattr(board, p) for p in dir(board)]
38+
if isinstance(pin, Pin) and pin not in exclude
39+
]
2340
unique = []
2441
for p in pins:
2542
if p not in unique:

CircuitPython_Templates/i2s_find_pins/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_unique_pins():
2626
"DOTSTAR_DATA",
2727
"APA102_SCK",
2828
"APA102_MOSI",
29-
"L",
29+
"LED",
3030
"SWITCH",
3131
"BUTTON",
3232
]

0 commit comments

Comments
 (0)