You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In the example in the readme we have
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.
The text was updated successfully, but these errors were encountered: