GPIO pins can be leveraged to use as a on/off signal for both input and output, and PWM. Uses include reading a button, a motion sensor, driving a LED or a buzzer.
Package gpio defines the interfaces.
Package gpioreg permits enumerating all the available GPIO pins currently available.
On a Raspberry Pi 3, the following are synonyms, use the form you prefer:
gpioreg.ByName("11")
:
gpio numbergpioreg.ByName("GPIO11")
:
gpio name as defined per the
bcm238x CPU drivergpioreg.ByName("P1_23")
:
board header P1
position 23
name as defined by the
rpi board drivergpioreg.ByName("SPI0_CLK")
:
function clock on SPI bus 0rpi.P1_23
to
select the pin via its position on the boardbcm283x.GPIO11
for the
pin as defined by the CPUPackage pinreg permits enumerating all the available pin headers. This includes non-GPIO pins like ground, 3.3V and 5V pins, etc.