def get_unique_pins():
exclude = [
getattr(board, p)
for p in [
# This is not an exhaustive list of unexposed pins. Your results
# may include other pins that you cannot easily connect to.
"NEOPIXEL",
"DOTSTAR_CLOCK",
"DOTSTAR_DATA",
"APA102_SCK",
"APA102_MOSI",
"LED",
"SWITCH",
"BUTTON",
"ACCELEROMETER_INTERRUPT",
"VOLTAGE_MONITOR",
"MICROPHONE_CLOCK",
"MICROPHONE_DATA",
]
if p in dir(board)
]
pins = [
pin
for pin in [getattr(board, p) for p in dir(board)]
if isinstance(pin, Pin) and pin not in exclude
]
unique = []
for p in pins:
if p not in unique:
unique.append(p)
return unique
for scl_pin in get_unique_pins():
for sda_pin in get_unique_pins():
if scl_pin is sda_pin:
continue
if is_hardware_i2c(scl_pin, sda_pin):
print("SCL pin:", scl_pin, "\t SDA pin:", sda_pin)
Now, connect to the serial console and check out the output! The results print out a
nice handy list of SCL and SDA pin pairs that support I2C.
The output for the ESP32-S3 TFT Feather is extremely long! The screenshot
shows only the beginning. Run the script yourself to see the full output
©Adafruit Industries Page 164 of 263