Skip to content

Instantly share code, notes, and snippets.

@anecdata
Last active May 5, 2021
Embed
What would you like to do?
CircuitPython Pin Finder: microcontroller.pin to board mappings
import microcontroller
import board
for pin in dir(microcontroller.pin):
if isinstance(getattr(microcontroller.pin, pin), microcontroller.Pin):
print("".join(("microcontroller.pin.", pin, "\t")), end=" ")
for alias in dir(board):
if getattr(board, alias) is getattr(microcontroller.pin, pin):
print("".join(("", "board.", alias)), end=" ")
print()
@anecdata

This comment has been minimized.

Copy link
Owner Author

@anecdata anecdata commented Feb 2, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment