Before we can start working with Python GPIO libraries and controlling electronics, one task we need to perform is to enable the GPIO interfaces on your Raspberry Pi. Even though we have installed Python packages for GPIO control, we have not told Raspbian OS that we want to use the Raspberry Pi's GPIO Pins for specific cases. Let's do that now.
Here are the steps to follow:
- From your Raspbian desktop, navigate to the Raspberry menu | Preferences | Raspberry Pi Configuration, as shown here in Figure 1.2:
Figure 1.2 – Location of the Raspberry Pi Configuration menu item
Alternatively, interfaces can be managed at the command line with the sudo raspi-config command and navigating to the Interfacing Options menu.
- Enable all of the interfaces as shown in the following screenshot:
Figure 1.3 - Raspberry Pi Configuration Dialog
- Click the OK button.
After you click the OK button, you may be prompted to reboot your Raspberry Pi; however, do not confirm the reboot just yet because there is one more task we need to perform first. We'll look at that next.