GPIO

Generic digital input/output support

Overview

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.

GPIO registry

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:

Pin registry

Package pinreg permits enumerating all the available pin headers. This includes non-GPIO pins like ground, 3.3V and 5V pins, etc.

Examples