Skip to content
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

Make pin numbering scheme obvious without the need to read the docs #121

Open
anohren opened this issue Sep 8, 2021 · 0 comments
Open

Comments

@anohren
Copy link

anohren commented Sep 8, 2021

In the example in the readme we have

let gpios = SwiftyGPIO.GPIOs(for:.RaspberryPi3)
var gp = gpios[.P2]!

This innocent snippet requires you to read the readme to understand it, since despite literally passing the words "Raspberry Pi" you don't get the pin numbers for the Pi, but for BCMxxxx.

My suggestion is to make the api more self documenting by returning the Pi pins when passed a Pi, and the Broadcom numbers when passed a BCM device.

This took me some time to figure out since I was so sure the code was telling me that I was getting the Pi numbering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant