Learn
To communicate with the outside world, the Raspberry Pi has a component called the GPIO, which stands for General Purpose Input Output.
The GPIO is a set of 40 pins that are located on the side of the Raspberry Pi and are used for a variety of hardware applications.
As their name suggests, the GPIO pins are capable of both the input and output of data. In this lesson, we will focus on using the GPIO to light up LEDs!
Instructions
The image in the workspace identifies each pin number for the GPIO and the function it provides:
- Pins
1
and17
: 3.3V supply, which equates to the positive terminal on a 3.3V electric supply. - Pins
2
and4
: 5V supply, which equates to the positive terminal on a 5V electric supply. - Pins
6
,9
,14
,20
,25
,30
,34
and39
: Ground, the negative terminal on any power supply.
The remaining 28 pins (17 on older models) are Input-Output pins. Labeled “GPIO#”, the I/O pins can act as input to read 0 or 3.3V or act as output to supply 0V or 3.3V.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.