pimoroni / physical_feather_pins

̶L̶e̶t̶'̶s̶ ̶g̶e̶t̶ ̶p̶h̶y̶s̶i̶c̶a̶l̶,̶ ̶p̶h̶y̶s̶i̶c̶a̶l̶. A library for circuitpython to access pins on feather boards by their physical number/location

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Physical Feather Pins

A library to provide consistent pin access between different feathers.

(Modification of https://github.com/ATMakersOrg/HoldingArea/blob/master/FeatherTemplate.svg)

Example

Original Code:

import board, digitalio
pin16 = digitalio.DigitalInOut(board.D4) # works on M4, but not M0 or nRF52840
pin16.switch_to_output()
pin16.value = True

Using Physical Feather Pins:

import pimoroni_physical_feather_pins, digitalio
pin16 = digitalio.DigitalInOut(pimoroni_physical_feather_pins.pin16())
# works on all feathers with a gpio there, gives a verbose error on M0 for example, note the parentheses
pin16.switch_to_output()
pin16.value = True

Tested

  • M4 Express
  • M0 Express
  • nRF52840 Express
  • Feather STM32F405 Express
  • Feather S2

Untested but should work

  • Adafruit Feather M0 Adalogger
  • Adafruit Feather M0 Basic
  • Adafruit Feather M0 RFM69
  • Adafruit Feather M0 RFM9x

About

̶L̶e̶t̶'̶s̶ ̶g̶e̶t̶ ̶p̶h̶y̶s̶i̶c̶a̶l̶,̶ ̶p̶h̶y̶s̶i̶c̶a̶l̶. A library for circuitpython to access pins on feather boards by their physical number/location

License:MIT License


Languages

Language:Python 100.0%